about summary refs log tree commit diff
path: root/app/javascript/flavours/glitch/reducers
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2021-05-19 23:51:05 +0200
committerClaire <claire.github-309c@sitedethib.com>2021-05-22 13:20:07 +0200
commit1a591ffc8b650f815ab37be6319d8132e591bdb2 (patch)
treeea263f29dc0991da1f74e23e2ac305e3c4cd4bab /app/javascript/flavours/glitch/reducers
parentbb0c9fcde7acfb2385480996412f1b8cb429a59f (diff)
[Glitch] Fix unread notification count when polling
Port 92f1d739b554b6d5496013fb50196a14434943e2 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
Diffstat (limited to 'app/javascript/flavours/glitch/reducers')
-rw-r--r--app/javascript/flavours/glitch/reducers/notifications.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/javascript/flavours/glitch/reducers/notifications.js b/app/javascript/flavours/glitch/reducers/notifications.js
index b4c5ef71a..859a8b3a1 100644
--- a/app/javascript/flavours/glitch/reducers/notifications.js
+++ b/app/javascript/flavours/glitch/reducers/notifications.js
@@ -112,7 +112,7 @@ const expandNormalizedNotifications = (state, notifications, next, isLoadingRece
     }
 
     if (shouldCountUnreadNotifications(state)) {
-      mutable.update('unread', unread => unread + items.count(item => compareId(item.get('id'), lastReadId) > 0));
+      mutable.set('unread', mutable.get('pendingItems').count(item => item !== null) + mutable.get('items').count(item => item && compareId(item.get('id'), lastReadId) > 0));
     } else {
       const mostRecent = items.find(item => item !== null);
       if (mostRecent && compareId(lastReadId, mostRecent.get('id')) < 0) {