2023-08-14 03:57:34 +00:00
|
|
|
import { mapGetters } from 'vuex'
|
|
|
|
|
|
|
|
const ExtraNotifications = {
|
|
|
|
computed: {
|
2023-08-19 00:02:58 +00:00
|
|
|
shouldShowChats () {
|
2023-08-19 00:34:27 +00:00
|
|
|
return this.mergedConfig.showExtraNotifications && this.mergedConfig.showChatsInExtraNotifications && this.unreadChatCount
|
2023-08-19 00:02:58 +00:00
|
|
|
},
|
|
|
|
shouldShowAnnouncements () {
|
2023-08-19 00:34:27 +00:00
|
|
|
return this.mergedConfig.showExtraNotifications && this.mergedConfig.showAnnouncementsInExtraNotifications && this.unreadAnnouncementCount
|
2023-08-19 00:02:58 +00:00
|
|
|
},
|
|
|
|
shouldShowFollowRequests () {
|
2023-08-19 00:34:27 +00:00
|
|
|
return this.mergedConfig.showExtraNotifications && this.mergedConfig.showFollowRequestsInExtraNotifications && this.followRequestCount
|
2023-08-19 00:02:58 +00:00
|
|
|
},
|
2023-08-19 00:34:27 +00:00
|
|
|
hasAnythingToShow () {
|
|
|
|
return this.shouldShowChats || this.shouldShowAnnouncements || this.shouldShowFollowRequests
|
|
|
|
},
|
|
|
|
shouldShowCustomizationTip () {
|
|
|
|
return this.mergedConfig.showExtraNotificationsTip && this.hasAnythingToShow
|
|
|
|
},
|
2023-08-19 00:39:14 +00:00
|
|
|
currentUser () {
|
|
|
|
return this.$store.state.users.currentUser
|
|
|
|
},
|
2023-08-19 00:34:27 +00:00
|
|
|
...mapGetters(['unreadChatCount', 'unreadAnnouncementCount', 'followRequestCount', 'mergedConfig'])
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
openNotificationSettings () {
|
|
|
|
return this.$store.dispatch('openSettingsModalTab', 'notifications')
|
|
|
|
},
|
|
|
|
dismissConfigurationTip () {
|
|
|
|
return this.$store.dispatch('setOption', { name: 'showExtraNotificationsTip', value: false })
|
|
|
|
}
|
2023-08-14 03:57:34 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default ExtraNotifications
|