diff --git a/client/src/stores/notificationsStore.ts b/client/src/stores/notificationsStore.ts index 589e9ce04c47..46f85203fbb8 100644 --- a/client/src/stores/notificationsStore.ts +++ b/client/src/stores/notificationsStore.ts @@ -37,6 +37,7 @@ export const useNotificationsStore = defineStore("notificationsStore", () => { loadingNotifications.value = true; await broadcastsStore.loadBroadcasts(); await loadNotifications(); + updateUnreadCount(); } else { const data = await loadNotificationsStatus(lastNotificationUpdate.value); totalUnreadCount.value = data.total_unread_count; @@ -78,6 +79,10 @@ export const useNotificationsStore = defineStore("notificationsStore", () => { return updateBatchNotification({ notification_ids: [notification.id], changes }); } + function updateUnreadCount() { + totalUnreadCount.value = notifications.value.filter((n) => !n.seen_time).length; + } + return { notifications, totalUnreadCount,