From a5ce24405b986f2dc9926b4b87ee80b1953456ee Mon Sep 17 00:00:00 2001 From: Beebles <102569435+beebls@users.noreply.github.com> Date: Fri, 26 Sep 2025 14:03:01 -0600 Subject: fix array length 0 check --- frontend/src/components/AnnouncementsDisplay.tsx | 94 ++++++++++++------------ 1 file changed, 49 insertions(+), 45 deletions(-) diff --git a/frontend/src/components/AnnouncementsDisplay.tsx b/frontend/src/components/AnnouncementsDisplay.tsx index 10ede13b..71b435ed 100644 --- a/frontend/src/components/AnnouncementsDisplay.tsx +++ b/frontend/src/components/AnnouncementsDisplay.tsx @@ -68,62 +68,66 @@ export function AnnouncementsDisplay() { void fetchAnnouncement(); } - if (!currentlyDisplayingAnnouncements) { + if (currentlyDisplayingAnnouncements.length === 0) { return null; } return ( - {currentlyDisplayingAnnouncements.map((announcement) => ( - hideAnnouncement(announcement.id)} /> - ))} + {currentlyDisplayingAnnouncements.map((announcement) => ( + hideAnnouncement(announcement.id)} + /> + ))} ); } -function Announcement({ announcement, onHide }: { announcement: Announcement, onHide: () => void }) { - // Severity is not implemented in the API currently +function Announcement({ announcement, onHide }: { announcement: Announcement; onHide: () => void }) { + // Severity is not implemented in the API currently const severity = SEVERITIES['Low']; return ( - -
- {announcement.title} - +
+ {announcement.title} + onHide()} + > + onHide()} - > - - -
- {announcement.text} - + /> +
+
+ {announcement.text} +
); -} \ No newline at end of file +} -- cgit v1.2.3