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 27
27
}
28
28
}
29
29
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
+ }
32
43
33
44
function handleClose() {
34
45
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 ();
38
47
}
39
48
}
40
49
You can’t perform that action at this time.
0 commit comments