diff --git a/routes/_actions/streaming.js b/routes/_actions/streaming.js index f0efbef2..f41a8824 100644 --- a/routes/_actions/streaming.js +++ b/routes/_actions/streaming.js @@ -6,7 +6,7 @@ import { scheduleIdleTask } from '../_utils/scheduleIdleTask' async function removeDuplicates (instanceName, timelineName, updates) { // remove duplicates, including duplicates due to reblogs - let timelineItemIds = store.getForTimeline(instanceName, timelineName, 'timelineItemIds') + let timelineItemIds = store.getForTimeline(instanceName, timelineName, 'timelineItemIds') || [] let reblogIds = (await Promise.all(timelineItemIds.map(async timelineItemId => { let status = await database.getStatus(instanceName, timelineItemId) return status.reblog && status.reblog.id @@ -30,9 +30,11 @@ async function handleFreshChanges (instanceName, timelineName) { await database.insertTimelineItems(instanceName, timelineName, updates) - let itemIdsToAdd = store.getForTimeline(instanceName, timelineName, 'itemIdsToAdd') || [] - itemIdsToAdd = itemIdsToAdd.concat(updates.map(_ => _.id)) - store.setForTimeline(instanceName, timelineName, {itemIdsToAdd: itemIdsToAdd}) + let itemIdsToAdd = store.getForTimeline(instanceName, timelineName, 'itemIdsToAdd') + if (itemIdsToAdd && itemIdsToAdd.length) { + itemIdsToAdd = itemIdsToAdd.concat(updates.map(_ => _.id)) + store.setForTimeline(instanceName, timelineName, {itemIdsToAdd: itemIdsToAdd}) + } } } diff --git a/routes/_actions/timeline.js b/routes/_actions/timeline.js index b935b963..a17596fb 100644 --- a/routes/_actions/timeline.js +++ b/routes/_actions/timeline.js @@ -59,6 +59,7 @@ export function initializeTimeline () { let timeline = store.get('currentTimeline') requestAnimationFrame(() => { requestAnimationFrame(() => { + console.log('initialized') store.setForTimeline(instanceName, timeline, {initialized: true}) }) }) diff --git a/routes/_components/LoadingPage.html b/routes/_components/LoadingPage.html index 0314c649..88e0d336 100644 --- a/routes/_components/LoadingPage.html +++ b/routes/_components/LoadingPage.html @@ -1,4 +1,4 @@ -
+