From eac0008002116efa9bf435c428a91cc2c0a2dd42 Mon Sep 17 00:00:00 2001 From: Tusooa Zhu Date: Sun, 20 Mar 2022 13:26:57 -0400 Subject: [PATCH] Readablify unreadAnnouncementCount --- src/modules/announcements.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/modules/announcements.js b/src/modules/announcements.js index 876bcdaf27..2606b786d6 100644 --- 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 } }