From 3545d940254423e9b6f298d5d88bb20327d0a0e9 Mon Sep 17 00:00:00 2001 From: guru_sainath Date: Mon, 22 Jul 2024 17:49:30 +0530 Subject: [PATCH] fix: mutating the inbox count on the sidebar and inbox tab when we click mark all as read (#5191) --- .../store/notifications/workspace-notifications.store.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/web/core/store/notifications/workspace-notifications.store.ts b/web/core/store/notifications/workspace-notifications.store.ts index 12791a7dfe3..59f0dbc0332 100644 --- a/web/core/store/notifications/workspace-notifications.store.ts +++ b/web/core/store/notifications/workspace-notifications.store.ts @@ -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(),