fix: mutating the inbox count on the sidebar and inbox tab when we click mark all as read (#5191)

This commit is contained in:
guru_sainath 2024-07-22 17:49:30 +05:30 committed by GitHub
parent 17e46c812a
commit 3545d94025
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -373,6 +373,13 @@ export class WorkspaceNotificationStore implements IWorkspaceNotificationStore {
};
await workspaceNotificationService.markAllNotificationsAsRead(workspaceSlug, params);
runInAction(() => {
update(
this.unreadNotificationsCount,
this.currentNotificationTab === ENotificationTab.ALL
? "total_unread_notifications_count"
: "mention_unread_notifications_count",
() => 0
);
Object.values(this.notifications).forEach((notification) =>
notification.mutateNotification({
read_at: new Date().toUTCString(),