Skip to content
Snippets Groups Projects
Commit 89bfc411 authored by Shpuld Shpludson's avatar Shpuld Shpludson
Browse files

Add a better check for fresh TL flushing

parent 4185452b
Branches
No related tags found
No related merge requests found
......@@ -29,9 +29,11 @@ const fetchAndUpdate = ({store, credentials, timeline = 'friends', older = false
args['userId'] = userId
args['tag'] = tag
const numStatusesBeforeFetch = timelineData.statuses.length
return apiService.fetchTimeline(args)
.then((statuses) => {
if (!older && statuses.length >= 20 && !timelineData.loading && timelineData.statuses.length) {
if (!older && statuses.length >= 20 && !timelineData.loading && numStatusesBeforeFetch > 0) {
store.dispatch('queueFlush', { timeline: timeline, id: timelineData.maxId })
}
update({store, statuses, timeline, showImmediately, userId})
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment