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
|
@ -65,7 +65,7 @@ const updateTimeline = (state, timeline, status, usePendingItems) => {
|
|||
return state;
|
||||
}
|
||||
|
||||
return state.update(timeline, initialTimeline, map => map.update('pendingItems', list => list.unshift(status.get('id'))));
|
||||
return state.update(timeline, initialTimeline, map => map.update('pendingItems', list => list.unshift(status.get('id'))).update('unread', unread => unread + 1));
|
||||
}
|
||||
|
||||
const top = state.getIn([timeline, 'top']);
|
||||
|
@ -128,7 +128,7 @@ const filterTimeline = (timeline, state, relationship, statuses) => {
|
|||
|
||||
const updateTop = (state, timeline, top) => {
|
||||
return state.update(timeline, initialTimeline, map => map.withMutations(mMap => {
|
||||
if (top) mMap.set('unread', 0);
|
||||
if (top) mMap.set('unread', mMap.get('pendingItems').size);
|
||||
mMap.set('top', top);
|
||||
}));
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue