From 305d54eb8b046feab7792611e29e527895342b1c Mon Sep 17 00:00:00 2001 From: pa Date: Wed, 25 Mar 2026 09:27:28 +0900 Subject: [PATCH] fix: view more button in notification center should navigate to notification page --- src/stores/ui.js | 19 +++++++++++++++---- .../components/NotificationCenterSheet.vue | 2 +- .../__tests__/NotificationCenterSheet.test.js | 3 ++- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/src/stores/ui.js b/src/stores/ui.js index 96d2a8e9..e780f125 100644 --- a/src/stores/ui.js +++ b/src/stores/ui.js @@ -287,9 +287,17 @@ export const useUiStore = defineStore('Ui', () => { const name = String(routeName); removeNotify(name); if (name === 'notification') { - const notificationsSettingsStore = useNotificationsSettingsStore(); - if (notificationsSettingsStore.notificationLayout === 'notification-center') { - router.replace({ name: 'feed' }); + const notificationsSettingsStore = + useNotificationsSettingsStore(); + if ( + notificationsSettingsStore.notificationLayout === + 'notification-center' + ) { + if (router.currentRoute.value.query?.fromCenter) { + router.replace({ name: 'notification' }); + } else { + router.replace({ name: 'feed' }); + } return; } notificationStore.clearUnseenNotifications(); @@ -322,7 +330,10 @@ export const useUiStore = defineStore('Ui', () => { function updateTrayIconNotify(force = false) { const notificationsSettingsStore = useNotificationsSettingsStore(); let newState; - if (notificationsSettingsStore.notificationLayout === 'notification-center') { + if ( + notificationsSettingsStore.notificationLayout === + 'notification-center' + ) { newState = appearanceSettings.notificationIconDot && (notificationStore.hasUnseenNotifications || diff --git a/src/views/Sidebar/components/NotificationCenterSheet.vue b/src/views/Sidebar/components/NotificationCenterSheet.vue index 38fcd608..84412d81 100644 --- a/src/views/Sidebar/components/NotificationCenterSheet.vue +++ b/src/views/Sidebar/components/NotificationCenterSheet.vue @@ -117,7 +117,7 @@ function navigateToTable() { isNotificationCenterOpen.value = false; - router.push({ name: 'notification' }); + router.push({ name: 'notification', query: { fromCenter: '1' } }); } function showSendInviteResponseDialog(invite) { diff --git a/src/views/Sidebar/components/__tests__/NotificationCenterSheet.test.js b/src/views/Sidebar/components/__tests__/NotificationCenterSheet.test.js index 8ed1cfde..c15ca860 100644 --- a/src/views/Sidebar/components/__tests__/NotificationCenterSheet.test.js +++ b/src/views/Sidebar/components/__tests__/NotificationCenterSheet.test.js @@ -150,7 +150,8 @@ describe('NotificationCenterSheet.vue', () => { false ); expect(mocks.router.push).toHaveBeenCalledWith({ - name: 'notification' + name: 'notification', + query: { fromCenter: '1' } }); });