mirror of
https://github.com/SteamDeckHomebrew/decky-loader.git
synced 2026-07-12 05:52:00 +00:00
fix array length 0 check
This commit is contained in:
@@ -68,20 +68,24 @@ export function AnnouncementsDisplay() {
|
||||
void fetchAnnouncement();
|
||||
}
|
||||
|
||||
if (!currentlyDisplayingAnnouncements) {
|
||||
if (currentlyDisplayingAnnouncements.length === 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<PanelSection>
|
||||
{currentlyDisplayingAnnouncements.map((announcement) => (
|
||||
<Announcement key={announcement.id} announcement={announcement} onHide={() => hideAnnouncement(announcement.id)} />
|
||||
<Announcement
|
||||
key={announcement.id}
|
||||
announcement={announcement}
|
||||
onHide={() => hideAnnouncement(announcement.id)}
|
||||
/>
|
||||
))}
|
||||
</PanelSection>
|
||||
);
|
||||
}
|
||||
|
||||
function Announcement({ announcement, onHide }: { announcement: Announcement, onHide: () => void }) {
|
||||
function Announcement({ announcement, onHide }: { announcement: Announcement; onHide: () => void }) {
|
||||
// Severity is not implemented in the API currently
|
||||
const severity = SEVERITIES['Low'];
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user