Add a better check for fresh TL flushing

このコミットが含まれているのは:
shpuld 2019-01-29 18:40:49 +02:00
コミット 89bfc41174
1個のファイルの変更3行の追加1行の削除

ファイルの表示

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