diff options
author | ThibG <thib@sitedethib.com> | 2019-09-16 15:45:06 +0200 |
---|---|---|
committer | Thibaut Girka <thib@sitedethib.com> | 2019-09-18 17:27:51 +0200 |
commit | 75673cf8e35ae985a7f8608b8764a77256d57712 (patch) | |
tree | 945d1f19663ac2eab67067ffa578bb1de2aa0037 /app/javascript/flavours/glitch/reducers/timelines.js | |
parent | 15a37a967cdf5bd1e935efc8866f6ac40d49db6b (diff) |
[Glitch] Fix “slow mode” issues
Port f1098675782944fe1dabec71cd58d3d091da06a0 to glitch-soc Signed-off-by: Thibaut Girka <thib@sitedethib.com>
Diffstat (limited to 'app/javascript/flavours/glitch/reducers/timelines.js')
-rw-r--r-- | app/javascript/flavours/glitch/reducers/timelines.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/javascript/flavours/glitch/reducers/timelines.js b/app/javascript/flavours/glitch/reducers/timelines.js index 9b016a4c6..7fb0a7fc1 100644 --- a/app/javascript/flavours/glitch/reducers/timelines.js +++ b/app/javascript/flavours/glitch/reducers/timelines.js @@ -64,7 +64,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']); @@ -127,7 +127,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); })); }; |