notification-related settings
This commit is contained in:
parent
a4845bf275
commit
3fbf21a757
4 changed files with 21 additions and 9 deletions
|
|
@ -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 (
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue