Do not count unread announcements for guests
This commit is contained in:
parent
8cb7f7d6d2
commit
d6dd394cd9
1 changed files with 5 additions and 1 deletions
|
@ -26,7 +26,11 @@ export const mutations = {
|
|||
}
|
||||
|
||||
export const getters = {
|
||||
unreadAnnouncementCount (state) {
|
||||
unreadAnnouncementCount (state, _getters, rootState) {
|
||||
if (!rootState.users.currentUser) {
|
||||
return 0
|
||||
}
|
||||
|
||||
return state.announcements.reduce((acc, cur) => {
|
||||
return (!cur.inactive && !cur.read) ? acc + 1 : acc
|
||||
}, 0)
|
||||
|
|
Loading…
Reference in a new issue