From 9641b7ad1eaab485aed8d5bdf8cd3d3a939397c6 Mon Sep 17 00:00:00 2001 From: Nolan Lawson Date: Fri, 31 Aug 2018 09:12:48 -0700 Subject: [PATCH] tweak timeline loading and worker dev mode (#525) --- routes/_actions/timeline.js | 3 +++ routes/_components/timeline/LoadingFooter.html | 8 +++++++- routes/_components/timeline/Timeline.html | 9 ++++++++- routes/_database/database.dev.js | 3 --- routes/_database/database.js | 8 ++------ routes/_database/database.workerize.js | 3 +++ webpack.client.config.js | 14 ++++++-------- 7 files changed, 29 insertions(+), 19 deletions(-) delete mode 100644 routes/_database/database.dev.js create mode 100644 routes/_database/database.workerize.js diff --git a/routes/_actions/timeline.js b/routes/_actions/timeline.js index 7747982..09bad11 100644 --- a/routes/_actions/timeline.js +++ b/routes/_actions/timeline.js @@ -45,6 +45,7 @@ async function fetchTimelineItems (instanceName, accessToken, timelineName, last stale = true } else { try { + console.log('fetchTimelineItemsFromNetwork') items = await fetchTimelineItemsFromNetwork(instanceName, accessToken, timelineName, lastTimelineItemId) /* no await */ storeFreshTimelineItemsInDatabase(instanceName, timelineName, items) } catch (e) { @@ -115,9 +116,11 @@ export async function setupTimeline () { } export async function fetchTimelineItemsOnScrollToBottom (instanceName, timelineName) { + 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 } diff --git a/routes/_components/timeline/LoadingFooter.html b/routes/_components/timeline/LoadingFooter.html index dfff3d5..a443016 100644 --- a/routes/_components/timeline/LoadingFooter.html +++ b/routes/_components/timeline/LoadingFooter.html @@ -1,4 +1,4 @@ -