Skip to content

Commit

Permalink
move welcome announcement to default
Browse files Browse the repository at this point in the history
  • Loading branch information
beebls committed Sep 14, 2024
1 parent 91e4d6c commit ab3b69f
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions frontend/src/components/AnnouncementsDisplay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const welcomeAnnouncement: Announcement = {
};

export function AnnouncementsDisplay() {
const [announcements, setAnnouncements] = useState<Announcement[]>([]);
const [announcements, setAnnouncements] = useState<Announcement[]>([welcomeAnnouncement]);
// showWelcome will display a welcome motd, the welcome motd has an id of "welcome" and once that is saved to hiddenMotdId, it will not show again
const [hiddenAnnouncementIds, setHiddenAnnouncementIds] = useSetting<string[]>('hiddenAnnouncementIds', []);

Expand All @@ -54,11 +54,6 @@ export function AnnouncementsDisplay() {
useEffect(() => {
void fetchAnnouncement();
}, []);
useEffect(() => {
if (hiddenAnnouncementIds.length > 0) {
addAnnouncements([welcomeAnnouncement]);
}
}, [hiddenAnnouncementIds]);

const currentlyDisplayingAnnouncement: Announcement | null = useMemo(() => {
return announcements.find((announcement) => !hiddenAnnouncementIds.includes(announcement.id)) || null;
Expand Down

0 comments on commit ab3b69f

Please sign in to comment.