mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
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.
This commit is contained in:
@@ -40,7 +40,14 @@ export const InboxItem: FC<InboxItemProps> = ({
|
||||
{notification.actions.map((action) => {
|
||||
return (
|
||||
<Button variant="outline" size="sm" key={action.label} asChild>
|
||||
<RouterLink to={action.url}>{action.label}</RouterLink>
|
||||
<RouterLink
|
||||
to={action.url}
|
||||
onClick={() => {
|
||||
onMarkNotificationAsRead(notification.id);
|
||||
}}
|
||||
>
|
||||
{action.label}
|
||||
</RouterLink>
|
||||
</Button>
|
||||
);
|
||||
})}
|
||||
|
||||
Reference in New Issue
Block a user