1
0
Fork 0
mirror of https://akkoma.dev/AkkomaGang/akkoma-fe synced 2025-07-08 12:47:18 +08:00

Merge branch 'fix/timeline-too-eager-flush' into 'develop'

Fix  Add a better check for fresh TL flushing

Closes 

See merge request 
This commit is contained in:
lambda 2019-01-30 17:51:12 +00:00
commit b1facdf7ad

View file

@ -29,9 +29,11 @@ const fetchAndUpdate = ({store, credentials, timeline = 'friends', older = false
args['userId'] = userId args['userId'] = userId
args['tag'] = tag args['tag'] = tag
const numStatusesBeforeFetch = timelineData.statuses.length
return apiService.fetchTimeline(args) return apiService.fetchTimeline(args)
.then((statuses) => { .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 }) store.dispatch('queueFlush', { timeline: timeline, id: timelineData.maxId })
} }
update({store, statuses, timeline, showImmediately, userId}) update({store, statuses, timeline, showImmediately, userId})