aboutsummaryrefslogtreecommitdiff
path: root/src/services/notification_utils
diff options
context:
space:
mode:
authorHenry Jameson <me@hjkos.com>2023-11-13 17:26:53 +0200
committerHenry Jameson <me@hjkos.com>2023-11-13 17:26:53 +0200
commitc059f4a7ee16c0128c348c43c9d468e7cfdb5ef7 (patch)
tree12e816bd639f1ef6fa531c0df602e115b2a99ca7 /src/services/notification_utils
parente0b8ad9f141f418ab3d8ebc7a9e68bcb755c820a (diff)
parent18c0cf1845a95db2d0e894d2455cdd4dc545aaf7 (diff)
Merge remote-tracking branch 'origin/develop' into notifications-thru-sw
Diffstat (limited to 'src/services/notification_utils')
-rw-r--r--src/services/notification_utils/notification_utils.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/services/notification_utils/notification_utils.js b/src/services/notification_utils/notification_utils.js
index 4c6c4d8a..fbd5c014 100644
--- a/src/services/notification_utils/notification_utils.js
+++ b/src/services/notification_utils/notification_utils.js
@@ -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)
+}