Merge remote-tracking branch 'origin/develop' into notifications-thru-sw

This commit is contained in:
Henry Jameson 2023-11-13 17:26:53 +02:00
commit c059f4a7ee
57 changed files with 1296 additions and 86 deletions

View file

@ -133,3 +133,17 @@ export const prepareNotificationObject = (notification, i18n) => {
return notifObj
}
export const countExtraNotifications = (store) => {
const mergedConfig = store.getters.mergedConfig
if (!mergedConfig.showExtraNotifications) {
return 0
}
return [
mergedConfig.showChatsInExtraNotifications ? store.getters.unreadChatCount : 0,
mergedConfig.showAnnouncementsInExtraNotifications ? store.getters.unreadAnnouncementCount : 0,
mergedConfig.showFollowRequestsInExtraNotifications ? store.getters.followRequestCount : 0
].reduce((a, c) => a + c, 0)
}