From 2a861cb9b66bf47bdd756360d1b5fdefbeba7535 Mon Sep 17 00:00:00 2001 From: pa Date: Sun, 8 Mar 2026 00:06:35 +0900 Subject: [PATCH] add mask as read context menu to noti center bell icon --- src/stores/notification/index.js | 17 +++++++++++- src/views/Sidebar/Sidebar.vue | 44 ++++++++++++++++++++++---------- 2 files changed, 47 insertions(+), 14 deletions(-) diff --git a/src/stores/notification/index.js b/src/stores/notification/index.js index 306946bb..a61104ac 100644 --- a/src/stores/notification/index.js +++ b/src/stores/notification/index.js @@ -478,6 +478,20 @@ export const useNotificationStore = defineStore('Notification', () => { processSeeQueue(); } + /** + * + */ + function markAllAsSeen() { + const unseenIds = [...unseenNotifications.value]; + for (const id of unseenIds) { + const ref = notificationTable.value.data.find((n) => n.id === id); + const version = ref?.version || 1; + queueMarkAsSeen(id, version); + } + unseenNotifications.value = []; + uiStore.removeNotify('notification'); + } + /** * * @param args @@ -1459,6 +1473,7 @@ export const useNotificationStore = defineStore('Notification', () => { getNotificationCategory, isNotificationExpired, openNotificationLink, - queueMarkAsSeen + queueMarkAsSeen, + markAllAsSeen }; }); diff --git a/src/views/Sidebar/Sidebar.vue b/src/views/Sidebar/Sidebar.vue index 101fbb29..52a32a49 100644 --- a/src/views/Sidebar/Sidebar.vue +++ b/src/views/Sidebar/Sidebar.vue @@ -26,18 +26,27 @@ - - - + + + + + + + + + {{ t('nav_menu.mark_all_read') }} + + +