diff options
| author | shpuld <shp@cock.li> | 2017-11-23 13:46:37 +0200 |
|---|---|---|
| committer | shpuld <shp@cock.li> | 2017-11-23 13:46:37 +0200 |
| commit | 6b773902e8dae36b2c4cf4c970fd1437cfdc13bc (patch) | |
| tree | 5afce3cc15815163ad9779d8d5cfe18a063011ef /src/services/timeline_fetcher | |
| parent | 912be5aed9c8616d4c5772617ab4eef9a50d9061 (diff) | |
Fix mistake in flushMarker init, make startFetching behave properly with older statuses existing.
Diffstat (limited to 'src/services/timeline_fetcher')
| -rw-r--r-- | src/services/timeline_fetcher/timeline_fetcher.service.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/services/timeline_fetcher/timeline_fetcher.service.js b/src/services/timeline_fetcher/timeline_fetcher.service.js index a02d67d0..a4a80df0 100644 --- a/src/services/timeline_fetcher/timeline_fetcher.service.js +++ b/src/services/timeline_fetcher/timeline_fetcher.service.js @@ -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) } |
