Change home timeline to reload after follow recommendations in web UI (#16160)

This commit is contained in:
Eugen Rochko
2021-05-07 14:33:57 +02:00
committed by GitHub
parent 74081433d0
commit 0ad240cb6b
7 changed files with 39 additions and 9 deletions

View File

@ -18,17 +18,26 @@ export const TIMELINE_LOAD_PENDING = 'TIMELINE_LOAD_PENDING';
export const TIMELINE_DISCONNECT = 'TIMELINE_DISCONNECT';
export const TIMELINE_CONNECT = 'TIMELINE_CONNECT';
export const TIMELINE_MARK_AS_PARTIAL = 'TIMELINE_MARK_AS_PARTIAL';
export const loadPending = timeline => ({
type: TIMELINE_LOAD_PENDING,
timeline,
});
export function updateTimeline(timeline, status, accept) {
return dispatch => {
return (dispatch, getState) => {
if (typeof accept === 'function' && !accept(status)) {
return;
}
if (getState().getIn(['timelines', timeline, 'isPartial'])) {
// Prevent new items from being added to a partial timeline,
// since it will be reloaded anyway
return;
}
dispatch(importFetchedStatus(status));
dispatch({
@ -183,3 +192,8 @@ export const disconnectTimeline = timeline => ({
timeline,
usePendingItems: preferPendingItems,
});
export const markAsPartial = timeline => ({
type: TIMELINE_MARK_AS_PARTIAL,
timeline,
});