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
|
return this.$store.state.users.currentUser
|
||||||
},
|
},
|
||||||
unseenNotifications() {
|
unseenNotifications() {
|
||||||
return unseenNotificationsFromStore(this.$store)
|
return unseenNotificationsFromStore(
|
||||||
|
this.$store,
|
||||||
|
useSyncConfigStore().mergedConfig.notificationVisibility,
|
||||||
|
)
|
||||||
},
|
},
|
||||||
unseenNotificationsCount() {
|
unseenNotificationsCount() {
|
||||||
return (
|
return (
|
||||||
|
|
|
||||||
|
|
@ -76,7 +76,10 @@ const Notifications = {
|
||||||
return this.$store.state.notifications.error
|
return this.$store.state.notifications.error
|
||||||
},
|
},
|
||||||
unseenNotifications() {
|
unseenNotifications() {
|
||||||
return unseenNotificationsFromStore(this.$store)
|
return unseenNotificationsFromStore(
|
||||||
|
this.$store,
|
||||||
|
useSyncConfigStore().mergedConfig.notificationVisibility,
|
||||||
|
)
|
||||||
},
|
},
|
||||||
filteredNotifications() {
|
filteredNotifications() {
|
||||||
if (this.unseenAtTop) {
|
if (this.unseenAtTop) {
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ import { useAnnouncementsStore } from 'src/stores/announcements'
|
||||||
import { useInstanceStore } from 'src/stores/instance.js'
|
import { useInstanceStore } from 'src/stores/instance.js'
|
||||||
import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.js'
|
import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.js'
|
||||||
import { useInterfaceStore } from 'src/stores/interface'
|
import { useInterfaceStore } from 'src/stores/interface'
|
||||||
|
import { useSyncConfigStore } from 'src/stores/sync_config.js'
|
||||||
import { useShoutStore } from 'src/stores/shout'
|
import { useShoutStore } from 'src/stores/shout'
|
||||||
|
|
||||||
import { library } from '@fortawesome/fontawesome-svg-core'
|
import { library } from '@fortawesome/fontawesome-svg-core'
|
||||||
|
|
@ -72,7 +73,10 @@ const SideDrawer = {
|
||||||
return useShoutStore().joined
|
return useShoutStore().joined
|
||||||
},
|
},
|
||||||
unseenNotifications() {
|
unseenNotifications() {
|
||||||
return unseenNotificationsFromStore(this.$store)
|
return unseenNotificationsFromStore(
|
||||||
|
this.$store,
|
||||||
|
useSyncConfigStore().mergedConfig.notificationVisibility,
|
||||||
|
)
|
||||||
},
|
},
|
||||||
unseenNotificationsCount() {
|
unseenNotificationsCount() {
|
||||||
return this.unseenNotifications.length
|
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 rootGetters = store.rootGetters || store.getters
|
||||||
const ignoreInactionableSeen = rootGetters.mergedConfig.ignoreInactionableSeen
|
const ignoreInactionableSeen = rootGetters.mergedConfig.ignoreInactionableSeen
|
||||||
|
|
||||||
return filteredNotificationsFromStore(store).filter(({ seen, type }) => {
|
return filteredNotificationsFromStore(store, notificationVisibility).filter(
|
||||||
if (!ignoreInactionableSeen) return !seen
|
({ seen, type }) => {
|
||||||
if (seen) return false
|
if (!ignoreInactionableSeen) return !seen
|
||||||
return ACTIONABLE_NOTIFICATION_TYPES.has(type)
|
if (seen) return false
|
||||||
})
|
return ACTIONABLE_NOTIFICATION_TYPES.has(type)
|
||||||
|
},
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
export const prepareNotificationObject = (notification, i18n) => {
|
export const prepareNotificationObject = (notification, i18n) => {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue