attempt to recognize when holes in timeline for various reasons, clear timeline and fetch older when showing new to get rid of holes

This commit is contained in:
shpuld 2017-11-21 16:12:47 +02:00
parent 8020363680
commit fc1736618b
5 changed files with 31 additions and 5 deletions

View file

@ -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}) => {