Browse Source

Fix issue checking for last unread notification when there are gaps (#14960)

closed-social-v3
ThibG 4 years ago
committed by GitHub
parent
commit
dc52a778e1
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      app/javascript/mastodon/reducers/notifications.js

+ 2
- 1
app/javascript/mastodon/reducers/notifications.js View File

@ -172,7 +172,8 @@ const shouldCountUnreadNotifications = (state, ignoreScroll = false) => {
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 && (ignoreScroll || isOnTop) && isMounted && lastItemReached);
};

Loading…
Cancel
Save