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
This commit is contained in:
parent
5eff29b28c
commit
f109867578
5 changed files with 15 additions and 7 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue