commit: eac0008002116efa9bf435c428a91cc2c0a2dd42
parent d6dd394cd9446a972bef4071d304b1edb63ec057
Author: Tusooa Zhu <tusooa@kazv.moe>
Date: Sun, 20 Mar 2022 13:26:57 -0400
Readablify unreadAnnouncementCount
Diffstat:
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/src/modules/announcements.js b/src/modules/announcements.js
@@ -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
}
}