From e2f6fbfc85eb6a2c851ac7c5406bcde0cba0e21a Mon Sep 17 00:00:00 2001 From: pa Date: Sat, 21 Feb 2026 19:05:46 +0900 Subject: [PATCH] Display only unseen notifications in the notification center and remove the past notifications section from the list --- src/stores/notification.js | 13 +++++++ .../components/NotificationCenterSheet.vue | 38 ++++++------------- .../Sidebar/components/NotificationList.vue | 34 ++--------------- 3 files changed, 28 insertions(+), 57 deletions(-) diff --git a/src/stores/notification.js b/src/stores/notification.js index 90743997..b50c1bb2 100644 --- a/src/stores/notification.js +++ b/src/stores/notification.js @@ -124,6 +124,16 @@ export const useNotificationStore = defineStore('Notification', () => { (n) => getNotificationCategory(n.type) === 'other' ) ); + const unseenSet = computed(() => new Set(unseenNotifications.value)); + const unseenFriendNotifications = computed(() => + friendNotifications.value.filter((n) => unseenSet.value.has(n.id)) + ); + const unseenGroupNotifications = computed(() => + groupNotifications.value.filter((n) => unseenSet.value.has(n.id)) + ); + const unseenOtherNotifications = computed(() => + otherNotifications.value.filter((n) => unseenSet.value.has(n.id)) + ); const hasUnseenNotifications = computed( () => unseenNotifications.value.length > 0 ); @@ -2703,6 +2713,9 @@ export const useNotificationStore = defineStore('Notification', () => { friendNotifications, groupNotifications, otherNotifications, + unseenFriendNotifications, + unseenGroupNotifications, + unseenOtherNotifications, hasUnseenNotifications, getNotificationCategory, isNotificationExpired, diff --git a/src/views/Sidebar/components/NotificationCenterSheet.vue b/src/views/Sidebar/components/NotificationCenterSheet.vue index 1000bdb4..f529daa1 100644 --- a/src/views/Sidebar/components/NotificationCenterSheet.vue +++ b/src/views/Sidebar/components/NotificationCenterSheet.vue @@ -10,43 +10,40 @@ {{ t('side_panel.notification_center.tab_friend') }} - - ({{ activeCount.friend }}) + + ({{ unseenFriendNotifications.length }}) {{ t('side_panel.notification_center.tab_group') }} - - ({{ activeCount.group }}) + + ({{ unseenGroupNotifications.length }}) {{ t('side_panel.notification_center.tab_other') }} - - ({{ activeCount.other }}) + + ({{ unseenOtherNotifications.length }}) @@ -65,7 +62,7 @@