Skip to content

Commit 2c53f7a

Browse files
feat: mark notification as read when action is clicked (#17095)
When a user clicks in a notification action we can infer the notification was read.
1 parent 33029c3 commit 2c53f7a

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

site/src/modules/notifications/NotificationsInbox/InboxItem.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,14 @@ export const InboxItem: FC<InboxItemProps> = ({
4040
{notification.actions.map((action) => {
4141
return (
4242
<Button variant="outline" size="sm" key={action.label} asChild>
43-
<RouterLink to={action.url}>{action.label}</RouterLink>
43+
<RouterLink
44+
to={action.url}
45+
onClick={() => {
46+
onMarkNotificationAsRead(notification.id);
47+
}}
48+
>
49+
{action.label}
50+
</RouterLink>
4451
</Button>
4552
);
4653
})}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy