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 state.announcements.reduce((acc, cur) => {
return (!cur.inactive && !cur.read) ? acc + 1 : acc
}, 0)
const unread = state.announcements.filter(announcement => !(announcement.inactive || announcement.read))
return unread.length
}
}