fix auto-loading of toot content as you scroll (#529)

This commit is contained in:
Nolan Lawson 2018-09-01 14:11:39 -07:00 committed by GitHub
parent 9d27ba6c10
commit 20dda272ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 6 deletions

View File

@ -10,8 +10,6 @@ import { getStatus, getStatusContext } from '../_api/statuses'
import { emit } from '../_utils/eventBus'
import { TIMELINE_BATCH_SIZE } from '../_static/timelines'
const SCROLL_TO_BOTTOM_DELAY = 2000
async function storeFreshTimelineItemsInDatabase (instanceName, timelineName, items) {
await database.insertTimelineItems(instanceName, timelineName, items)
if (timelineName.startsWith('status/')) {
@ -119,10 +117,8 @@ export async function fetchTimelineItemsOnScrollToBottom (instanceName, timeline
console.log('setting runningUpdate: true')
store.setForTimeline(instanceName, timelineName, { runningUpdate: true })
await fetchTimelineItemsAndPossiblyFallBack()
setTimeout(() => {
console.log('setting runningUpdate: false')
store.setForTimeline(instanceName, timelineName, { runningUpdate: false })
}, SCROLL_TO_BOTTOM_DELAY) // delay to avoid spamming network calls on scroll to bottom
console.log('setting runningUpdate: false')
store.setForTimeline(instanceName, timelineName, { runningUpdate: false })
}
export async function showMoreItemsForTimeline (instanceName, timelineName) {