[Glitch] Use randomized setTimeout when fallback-polling and re-add since_id

Port dafd7afc5e to glitch-soc
This commit is contained in:
Thibaut Girka
2018-05-27 19:42:45 +02:00
committed by ThibG
parent fbc25bdd2d
commit cc589d6ec0
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');