aboutsummaryrefslogtreecommitdiff
path: root/src/components/notifications
diff options
context:
space:
mode:
authortusooa <tusooa@kazv.moe>2023-08-18 21:07:48 -0400
committertusooa <tusooa@kazv.moe>2023-08-18 22:25:32 -0400
commit50bad0fc68dee158e1681e599c7852550f5bef31 (patch)
treef8240463a6c6d84e1bac60983a6ded27649c214d /src/components/notifications
parentbd60238f010df2554e88639f21003487ec503704 (diff)
Display unread visuals when there are unread extra notifications
Diffstat (limited to 'src/components/notifications')
-rw-r--r--src/components/notifications/notifications.js18
-rw-r--r--src/components/notifications/notifications.vue4
2 files changed, 17 insertions, 5 deletions
diff --git a/src/components/notifications/notifications.js b/src/components/notifications/notifications.js
index 09ebc943..571df0f1 100644
--- a/src/components/notifications/notifications.js
+++ b/src/components/notifications/notifications.js
@@ -7,7 +7,8 @@ import notificationsFetcher from '../../services/notifications_fetcher/notificat
import {
notificationsFromStore,
filteredNotificationsFromStore,
- unseenNotificationsFromStore
+ unseenNotificationsFromStore,
+ countExtraNotifications
} from '../../services/notification_utils/notification_utils.js'
import FaviconService from '../../services/favicon_service/favicon_service.js'
import { library } from '@fortawesome/fontawesome-svg-core'
@@ -33,6 +34,11 @@ const Notifications = {
minimalMode: Boolean,
// Custom filter mode, an array of strings, possible values 'mention', 'repeat', 'like', 'follow', used to override global filter for use in "Interactions" timeline
filterMode: Array,
+ // Do not show extra notifications
+ noExtra: {
+ type: Boolean,
+ default: false
+ },
// Disable teleporting (i.e. for /users/user/notifications)
disableTeleport: Boolean
},
@@ -67,11 +73,17 @@ const Notifications = {
filteredNotifications () {
return filteredNotificationsFromStore(this.$store, this.filterMode)
},
+ unseenCountBadgeText () {
+ return `${this.unseenCount ? this.unseenCount : ''}${this.extraNotificationsCount ? '*' : ''}`
+ },
unseenCount () {
return this.unseenNotifications.length
},
+ extraNotificationsCount () {
+ return countExtraNotifications(this.$store)
+ },
unseenCountTitle () {
- return this.unseenCount + (this.unreadChatCount) + this.unreadAnnouncementCount
+ return this.unseenNotifications.length + (this.unreadChatCount) + this.unreadAnnouncementCount
},
loading () {
return this.$store.state.statuses.notifications.loading
@@ -97,7 +109,7 @@ const Notifications = {
},
noSticky () { return this.$store.getters.mergedConfig.disableStickyHeaders },
showExtraNotifications () {
- return !this.noHeading
+ return !this.noExtra
},
...mapGetters(['unreadChatCount', 'unreadAnnouncementCount'])
},
diff --git a/src/components/notifications/notifications.vue b/src/components/notifications/notifications.vue
index d40c930a..999f8e9c 100644
--- a/src/components/notifications/notifications.vue
+++ b/src/components/notifications/notifications.vue
@@ -17,9 +17,9 @@
<div class="title">
{{ $t('notifications.notifications') }}
<span
- v-if="unseenCount"
+ v-if="unseenCountBadgeText"
class="badge badge-notification unseen-count"
- >{{ unseenCount }}</span>
+ >{{ unseenCountBadgeText }}</span>
</div>
<div
v-if="showScrollTop"