Readablify unreadAnnouncementCount

This commit is contained in:
Tusooa Zhu 2022-03-20 13:26:57 -04:00 committed by tusooa
parent d6dd394cd9
commit eac0008002
No known key found for this signature in database
GPG Key ID: 7B467EDE43A08224

View File

@ -31,9 +31,8 @@ export const getters = {
return 0 return 0
} }
return state.announcements.reduce((acc, cur) => { const unread = state.announcements.filter(announcement => !(announcement.inactive || announcement.read))
return (!cur.inactive && !cur.read) ? acc + 1 : acc return unread.length
}, 0)
} }
} }