lightened up notification utils by remove store stuff from it
This commit is contained in:
parent
ec05b20b06
commit
a31e6f660a
6 changed files with 13 additions and 14 deletions
|
|
@ -2,7 +2,6 @@ import { showDesktopNotification } from '../desktop_notification_utils/desktop_n
|
|||
import { muteFilterHits } from '../status_parser/status_parser.js'
|
||||
|
||||
import { useAnnouncementsStore } from 'src/stores/announcements.js'
|
||||
import { useI18nStore } from 'src/stores/i18n.js'
|
||||
|
||||
import FaviconService from 'src/services/favicon_service/favicon_service.js'
|
||||
|
||||
|
|
@ -76,6 +75,7 @@ export const maybeShowNotification = (
|
|||
notificationVisibility,
|
||||
muteFilters,
|
||||
notification,
|
||||
i18n,
|
||||
) => {
|
||||
const rootState = store.rootState || store.state
|
||||
|
||||
|
|
@ -89,7 +89,7 @@ export const maybeShowNotification = (
|
|||
|
||||
const notificationObject = prepareNotificationObject(
|
||||
notification,
|
||||
useI18nStore().i18n,
|
||||
i18n,
|
||||
)
|
||||
showDesktopNotification(rootState, notificationObject)
|
||||
}
|
||||
|
|
@ -193,7 +193,7 @@ export const prepareNotificationObject = (notification, i18n) => {
|
|||
return notifObj
|
||||
}
|
||||
|
||||
export const countExtraNotifications = (store, mergedConfig) => {
|
||||
export const countExtraNotifications = (store, mergedConfig, unreadAnnouncementCount) => {
|
||||
const rootGetters = store.rootGetters || store.getters
|
||||
|
||||
if (!mergedConfig.showExtraNotifications) {
|
||||
|
|
@ -205,7 +205,7 @@ export const countExtraNotifications = (store, mergedConfig) => {
|
|||
? rootGetters.unreadChatCount
|
||||
: 0,
|
||||
mergedConfig.showAnnouncementsInExtraNotifications
|
||||
? useAnnouncementsStore().unreadAnnouncementCount
|
||||
? unreadAnnouncementCount
|
||||
: 0,
|
||||
mergedConfig.showFollowRequestsInExtraNotifications
|
||||
? rootGetters.followRequestCount
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue