Skip to content

Commit

Permalink
Merge pull request louislam#2975 from chakflying/fix/badge-no-label
Browse files Browse the repository at this point in the history
Fix: Allow status badge with empty label
  • Loading branch information
louislam authored Mar 26, 2023
2 parents 4869e65 + 4f05912 commit 41bda4e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion server/routers/api-router.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 41bda4e

Please sign in to comment.