From 20dda272ba13b2c6829d7ff17e84410bddff36b2 Mon Sep 17 00:00:00 2001 From: Nolan Lawson Date: Sat, 1 Sep 2018 14:11:39 -0700 Subject: [PATCH] fix auto-loading of toot content as you scroll (#529) --- routes/_actions/timeline.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/routes/_actions/timeline.js b/routes/_actions/timeline.js index 09bad11..2e2ecf9 100644 --- a/routes/_actions/timeline.js +++ b/routes/_actions/timeline.js @@ -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) {