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/timelines.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/timelines.js')
-rw-r--r-- | app/javascript/mastodon/reducers/timelines.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/javascript/mastodon/reducers/timelines.js b/app/javascript/mastodon/reducers/timelines.js index 0b036f5fe..db45d4d40 100644 --- a/app/javascript/mastodon/reducers/timelines.js +++ b/app/javascript/mastodon/reducers/timelines.js @@ -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); })); }; |