File tree Expand file tree Collapse file tree 1 file changed +14
-5
lines changed
Expand file tree Collapse file tree 1 file changed +14
-5
lines changed Original file line number Diff line number Diff line change 2727 }
2828 }
2929
30- const handleClick = () =>
31- latestUnreadAnnouncement && goto (` /announcements/${latestUnreadAnnouncement .id } ` );
30+ function setAsRead() {
31+ if (! latestUnreadAnnouncement ) return ;
32+ $read_announcements .add (latestUnreadAnnouncement .id );
33+ localStorage .setItem (' read_announcements' , JSON .stringify (Array .from ($read_announcements )));
34+ latestUnreadAnnouncement = undefined ;
35+ }
36+
37+ function handleClick() {
38+ if (latestUnreadAnnouncement ) {
39+ goto (` /announcements/${latestUnreadAnnouncement .id } ` );
40+ setAsRead ();
41+ }
42+ }
3243
3344 function handleClose() {
3445 if (latestUnreadAnnouncement && browser ) {
35- $read_announcements .add (latestUnreadAnnouncement .id );
36- localStorage .setItem (' read_announcements' , JSON .stringify (Array .from ($read_announcements )));
37- latestUnreadAnnouncement = undefined ;
46+ setAsRead ();
3847 }
3948 }
4049
You can’t perform that action at this time.
0 commit comments