From 4f05912276e106cc9e708e230a8313b51c3cd1ee Mon Sep 17 00:00:00 2001 From: Nelson Chan Date: Sat, 25 Mar 2023 02:44:15 +0800 Subject: [PATCH] Fix: Allow status badge with empty label --- server/routers/api-router.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server/routers/api-router.js b/server/routers/api-router.js index a36159ca..84c3d3f3 100644 --- a/server/routers/api-router.js +++ b/server/routers/api-router.js @@ -147,7 +147,11 @@ router.get("/api/badge/:id/status", cache("5 minutes"), async (request, response const heartbeat = await Monitor.getPreviousHeartbeat(requestedMonitorId); const state = overrideValue !== undefined ? overrideValue : heartbeat.status; - badgeValues.label = label ?? "Status"; + if (label === undefined) { + badgeValues.label = "Status"; + } else { + badgeValues.label = label; + } switch (state) { case DOWN: badgeValues.color = downColor;