Skip to content

Commit

Permalink
Fix announcement bar showing no matter what
Browse files Browse the repository at this point in the history
Resolves #1
  • Loading branch information
imlayered committed Dec 15, 2024
1 parent 51f8e12 commit 0499038
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 4 additions & 1 deletion data.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
"OverallStatus": "NoOverride",
"RandomOperationalMessage": true,
"Whitelabel": false,
"announcement": {
"text": "Your announcement goes here!"
},
"maintenanceAlerts": [
{
"end": "2024-09-18T12:00:00Z",
Expand Down Expand Up @@ -72,4 +75,4 @@
"title": "This is a demo site!"
}
]
}
}
6 changes: 5 additions & 1 deletion static/js/uptimematrix.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,12 @@ document.addEventListener("DOMContentLoaded", () => {
return response.json();
})
.then((data) => {
if (data.sections.announcementBar)
if (data.sections.announcementBar) {
updateAnnouncementBar(data.announcement);
} else {
document.getElementById("announcement-bar").style.display = "none";
}

updateOverallStatus(
data.services,
data.RandomOperationalMessage,
Expand Down

0 comments on commit 0499038

Please sign in to comment.