diff options
author | ThibG <thib@sitedethib.com> | 2019-09-16 15:45:06 +0200 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2019-09-16 15:45:06 +0200 |
commit | f1098675782944fe1dabec71cd58d3d091da06a0 (patch) | |
tree | 6cabc8ea376ee626c744e882401a31a4bd7a7a75 /app/javascript/mastodon/reducers/notifications.js | |
parent | 5eff29b28c226e443ea5484ed50c8020a43fbc6b (diff) |
Fix “slow mode” issues (#11859)
* Fix weird scroll-jumping behavior with pending items * Treat pending items as unread items * Fix scroll position being altered because of the “X new items” button
Diffstat (limited to 'app/javascript/mastodon/reducers/notifications.js')
-rw-r--r-- | app/javascript/mastodon/reducers/notifications.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/javascript/mastodon/reducers/notifications.js b/app/javascript/mastodon/reducers/notifications.js index 049c70cb4..69bd47940 100644 --- a/app/javascript/mastodon/reducers/notifications.js +++ b/app/javascript/mastodon/reducers/notifications.js @@ -36,7 +36,7 @@ const notificationToMap = notification => ImmutableMap({ const normalizeNotification = (state, notification, usePendingItems) => { if (usePendingItems) { - return state.update('pendingItems', list => list.unshift(notificationToMap(notification))); + return state.update('pendingItems', list => list.unshift(notificationToMap(notification))).update('unread', unread => unread + 1); } const top = state.get('top'); @@ -91,7 +91,7 @@ const filterNotifications = (state, accountIds) => { const updateTop = (state, top) => { if (top) { - state = state.set('unread', 0); + state = state.set('unread', state.get('pendingItems').size); } return state.set('top', top); |