Make extra notification display customizable

This commit is contained in:
tusooa 2023-08-18 20:34:27 -04:00
commit 7f51ea369e
No known key found for this signature in database
GPG key ID: 42AEC43D48433C51
6 changed files with 105 additions and 5 deletions

View file

@ -3,15 +3,29 @@ import { mapGetters } from 'vuex'
const ExtraNotifications = {
computed: {
shouldShowChats () {
return this.unreadChatCount
return this.mergedConfig.showExtraNotifications && this.mergedConfig.showChatsInExtraNotifications && this.unreadChatCount
},
shouldShowAnnouncements () {
return this.unreadAnnouncementCount
return this.mergedConfig.showExtraNotifications && this.mergedConfig.showAnnouncementsInExtraNotifications && this.unreadAnnouncementCount
},
shouldShowFollowRequests () {
return this.followRequestCount
return this.mergedConfig.showExtraNotifications && this.mergedConfig.showFollowRequestsInExtraNotifications && this.followRequestCount
},
...mapGetters(['unreadChatCount', 'unreadAnnouncementCount', 'followRequestCount'])
hasAnythingToShow () {
return this.shouldShowChats || this.shouldShowAnnouncements || this.shouldShowFollowRequests
},
shouldShowCustomizationTip () {
return this.mergedConfig.showExtraNotificationsTip && this.hasAnythingToShow
},
...mapGetters(['unreadChatCount', 'unreadAnnouncementCount', 'followRequestCount', 'mergedConfig'])
},
methods: {
openNotificationSettings () {
return this.$store.dispatch('openSettingsModalTab', 'notifications')
},
dismissConfigurationTip () {
return this.$store.dispatch('setOption', { name: 'showExtraNotificationsTip', value: false })
}
}
}