Skip to content

Commit 2c53f7a

Browse files
feat: mark notification as read when action is clicked (coder#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

+8-1
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)