Skip to content

Commit

Permalink
Merge pull request #17349 from davelopez/23.2_fix_notification_badge_…
Browse files Browse the repository at this point in the history
…delay

[23.2] Fix notification badge delay
  • Loading branch information
martenson authored Jan 30, 2024
2 parents 64b945d + e4c6043 commit d840b8c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions client/src/stores/notificationsStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit d840b8c

Please sign in to comment.