From 3fbf21a757963c52bbb7d23666c70402035e7e19 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Sun, 15 Feb 2026 21:33:31 +0200 Subject: [PATCH] notification-related settings --- src/components/mobile_nav/mobile_nav.js | 5 ++++- src/components/notifications/notifications.js | 5 ++++- src/components/side_drawer/side_drawer.js | 6 +++++- .../notification_utils/notification_utils.js | 14 ++++++++------ 4 files changed, 21 insertions(+), 9 deletions(-) diff --git a/src/components/mobile_nav/mobile_nav.js b/src/components/mobile_nav/mobile_nav.js index 6242344ce..9230bb3c0 100644 --- a/src/components/mobile_nav/mobile_nav.js +++ b/src/components/mobile_nav/mobile_nav.js @@ -52,7 +52,10 @@ const MobileNav = { return this.$store.state.users.currentUser }, unseenNotifications() { - return unseenNotificationsFromStore(this.$store) + return unseenNotificationsFromStore( + this.$store, + useSyncConfigStore().mergedConfig.notificationVisibility, + ) }, unseenNotificationsCount() { return ( diff --git a/src/components/notifications/notifications.js b/src/components/notifications/notifications.js index 544901ebf..6d21ce0ea 100644 --- a/src/components/notifications/notifications.js +++ b/src/components/notifications/notifications.js @@ -76,7 +76,10 @@ const Notifications = { return this.$store.state.notifications.error }, unseenNotifications() { - return unseenNotificationsFromStore(this.$store) + return unseenNotificationsFromStore( + this.$store, + useSyncConfigStore().mergedConfig.notificationVisibility, + ) }, filteredNotifications() { if (this.unseenAtTop) { diff --git a/src/components/side_drawer/side_drawer.js b/src/components/side_drawer/side_drawer.js index 05d8e92f5..a906cd3ba 100644 --- a/src/components/side_drawer/side_drawer.js +++ b/src/components/side_drawer/side_drawer.js @@ -10,6 +10,7 @@ import { useAnnouncementsStore } from 'src/stores/announcements' import { useInstanceStore } from 'src/stores/instance.js' import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.js' import { useInterfaceStore } from 'src/stores/interface' +import { useSyncConfigStore } from 'src/stores/sync_config.js' import { useShoutStore } from 'src/stores/shout' import { library } from '@fortawesome/fontawesome-svg-core' @@ -72,7 +73,10 @@ const SideDrawer = { return useShoutStore().joined }, unseenNotifications() { - return unseenNotificationsFromStore(this.$store) + return unseenNotificationsFromStore( + this.$store, + useSyncConfigStore().mergedConfig.notificationVisibility, + ) }, unseenNotificationsCount() { return this.unseenNotifications.length diff --git a/src/services/notification_utils/notification_utils.js b/src/services/notification_utils/notification_utils.js index e5baa9a20..95902daef 100644 --- a/src/services/notification_utils/notification_utils.js +++ b/src/services/notification_utils/notification_utils.js @@ -105,15 +105,17 @@ export const filteredNotificationsFromStore = ( ) } -export const unseenNotificationsFromStore = (store) => { +export const unseenNotificationsFromStore = (store, notificationVisibility) => { const rootGetters = store.rootGetters || store.getters const ignoreInactionableSeen = rootGetters.mergedConfig.ignoreInactionableSeen - return filteredNotificationsFromStore(store).filter(({ seen, type }) => { - if (!ignoreInactionableSeen) return !seen - if (seen) return false - return ACTIONABLE_NOTIFICATION_TYPES.has(type) - }) + return filteredNotificationsFromStore(store, notificationVisibility).filter( + ({ seen, type }) => { + if (!ignoreInactionableSeen) return !seen + if (seen) return false + return ACTIONABLE_NOTIFICATION_TYPES.has(type) + }, + ) } export const prepareNotificationObject = (notification, i18n) => {