Fix mistake in flushMarker init, make startFetching behave properly with older statuses existing.

This commit is contained in:
shpuld 2017-11-23 13:46:37 +02:00
parent 912be5aed9
commit 6b773902e8
3 changed files with 20 additions and 11 deletions

View file

@ -38,7 +38,10 @@ const fetchAndUpdate = ({store, credentials, timeline = 'friends', older = false
}
const startFetching = ({timeline = 'friends', credentials, store, userId = false, tag = false}) => {
fetchAndUpdate({timeline, credentials, store, showImmediately: true, userId, tag})
const rootState = store.rootState || store.state
const timelineData = rootState.statuses.timelines[camelCase(timeline)]
const showImmediately = timelineData.visibleStatuses.length === 0
fetchAndUpdate({timeline, credentials, store, showImmediately, userId, tag})
const boundFetchAndUpdate = () => fetchAndUpdate({ timeline, credentials, store, userId, tag })
return setInterval(boundFetchAndUpdate, 10000)
}