diff options
| author | tusooa <tusooa@kazv.moe> | 2023-08-18 21:07:48 -0400 |
|---|---|---|
| committer | tusooa <tusooa@kazv.moe> | 2023-08-18 22:25:32 -0400 |
| commit | 50bad0fc68dee158e1681e599c7852550f5bef31 (patch) | |
| tree | f8240463a6c6d84e1bac60983a6ded27649c214d /src/services/notification_utils/notification_utils.js | |
| parent | bd60238f010df2554e88639f21003487ec503704 (diff) | |
Display unread visuals when there are unread extra notifications
Diffstat (limited to 'src/services/notification_utils/notification_utils.js')
| -rw-r--r-- | src/services/notification_utils/notification_utils.js | 14 |
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 0f8b9b02..815e792d 100644 --- a/src/services/notification_utils/notification_utils.js +++ b/src/services/notification_utils/notification_utils.js @@ -124,3 +124,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) +} |
