Use randomized setTimeout when fallback-polling and re-add since_id (#7522)

This commit is contained in:
Eugen Rochko
2018-05-18 02:32:35 +02:00
committed by GitHub
parent 1e02dc8715
commit dafd7afc5e
4 changed files with 43 additions and 19 deletions

View File

@ -36,10 +36,9 @@ export function connectTimelineStream (timelineId, path, pollingRefresh = null)
});
}
function refreshHomeTimelineAndNotification (dispatch) {
dispatch(expandHomeTimeline());
dispatch(expandNotifications());
}
const refreshHomeTimelineAndNotification = (dispatch, done) => {
dispatch(expandHomeTimeline({}, () => dispatch(expandNotifications({}, done))));
};
export const connectUserStream = () => connectTimelineStream('home', 'user', refreshHomeTimelineAndNotification);
export const connectCommunityStream = () => connectTimelineStream('community', 'public:local');