diff options
author | Fire Demon <firedemon@creature.cafe> | 2020-10-10 03:34:26 -0500 |
---|---|---|
committer | Fire Demon <firedemon@creature.cafe> | 2020-10-10 03:34:26 -0500 |
commit | 61a41564c50981a0f67e2cfb304ac319a4e7c58f (patch) | |
tree | a4649f264db81bd1ca3154d8d5b598e2a2142b2e /app/javascript/flavours/glitch | |
parent | 5c4a7ea6668fdfb76e26ddb76cdd3148c0e5083e (diff) | |
parent | cd861c051ce5500df49d2fc41b2a6084faa34620 (diff) |
Merge remote-tracking branch 'upstream/master' into dev
Diffstat (limited to 'app/javascript/flavours/glitch')
-rw-r--r-- | app/javascript/flavours/glitch/reducers/notifications.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/app/javascript/flavours/glitch/reducers/notifications.js b/app/javascript/flavours/glitch/reducers/notifications.js index 474ca3012..e136369ae 100644 --- a/app/javascript/flavours/glitch/reducers/notifications.js +++ b/app/javascript/flavours/glitch/reducers/notifications.js @@ -206,7 +206,8 @@ const shouldCountUnreadNotifications = (state) => { const isOnTop = state.get('top'); const isMounted = state.get('mounted') > 0; const lastReadId = state.get('lastReadId'); - const lastItemReached = !state.get('hasMore') || lastReadId === '0' || (!state.get('items').isEmpty() && compareId(state.get('items').last().get('id'), lastReadId) <= 0); + const lastItem = state.get('items').findLast(item => item !== null); + const lastItemReached = !state.get('hasMore') || lastReadId === '0' || (lastItem && compareId(lastItem.get('id'), lastReadId) <= 0); return !(isTabVisible && isOnTop && isMounted && lastItemReached); }; |