diff options
| author | shpuld <shp@cock.li> | 2017-11-21 16:12:47 +0200 |
|---|---|---|
| committer | shpuld <shp@cock.li> | 2017-11-21 16:12:47 +0200 |
| commit | fc1736618b4e1a9f178c0ae287754c6ac1244b08 (patch) | |
| tree | 08d5d4d05ddce8c9ec8f5ff48e55e1e4697f60c7 /src/services/timeline_fetcher | |
| parent | 80203636803c3035a46d0d82c7778e4aff8d2612 (diff) | |
attempt to recognize when holes in timeline for various reasons, clear timeline and fetch older when showing new to get rid of holes
Diffstat (limited to 'src/services/timeline_fetcher')
| -rw-r--r-- | src/services/timeline_fetcher/timeline_fetcher.service.js | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/services/timeline_fetcher/timeline_fetcher.service.js b/src/services/timeline_fetcher/timeline_fetcher.service.js index 6b76eb54..a02d67d0 100644 --- a/src/services/timeline_fetcher/timeline_fetcher.service.js +++ b/src/services/timeline_fetcher/timeline_fetcher.service.js @@ -29,8 +29,12 @@ const fetchAndUpdate = ({store, credentials, timeline = 'friends', older = false args['tag'] = tag return apiService.fetchTimeline(args) - .then((statuses) => update({store, statuses, timeline, showImmediately}), - () => store.dispatch('setError', { value: true })) + .then((statuses) => { + if (!older && statuses.length >= 20) { + store.dispatch('queueFlush', { timeline: timeline, id: timelineData.maxId }) + } + update({store, statuses, timeline, showImmediately}) + }, () => store.dispatch('setError', { value: true })) } const startFetching = ({timeline = 'friends', credentials, store, userId = false, tag = false}) => { |
