[Glitch] Fix “slow mode” issues
Port f109867578 to glitch-soc
Signed-off-by: Thibaut Girka <thib@sitedethib.com>
This commit is contained in:
@@ -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);
|
||||
}));
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user