[Glitch] Change home timeline to reload after follow recommendations in web UI

Port 0ad240cb6b to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
Eugen Rochko
2021-05-07 14:33:57 +02:00
committed by Claire
parent 5fa4138bd8
commit d30dd5b1db
5 changed files with 34 additions and 3 deletions

View File

@ -9,6 +9,7 @@ import {
TIMELINE_CONNECT,
TIMELINE_DISCONNECT,
TIMELINE_LOAD_PENDING,
TIMELINE_MARK_AS_PARTIAL,
} from 'flavours/glitch/actions/timelines';
import {
ACCOUNT_BLOCK_SUCCESS,
@ -173,6 +174,12 @@ export default function timelines(state = initialState, action) {
initialTimeline,
map => map.set('online', false).update(action.usePendingItems ? 'pendingItems' : 'items', items => items.first() ? items.unshift(null) : items),
);
case TIMELINE_MARK_AS_PARTIAL:
return state.update(
action.timeline,
initialTimeline,
map => map.set('isPartial', true).set('items', ImmutableList()).set('pendingItems', ImmutableList()).set('unread', 0),
);
default:
return state;
}