From 6a3345fe671a0bc7c78eb5c12ee952862522728c Mon Sep 17 00:00:00 2001 From: Nolan Lawson Date: Sun, 11 Feb 2018 16:18:53 -0800 Subject: [PATCH] fix error in updates --- routes/_actions/streaming.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/routes/_actions/streaming.js b/routes/_actions/streaming.js index f41a882..5fc7b2e 100644 --- a/routes/_actions/streaming.js +++ b/routes/_actions/streaming.js @@ -30,8 +30,8 @@ async function handleFreshChanges (instanceName, timelineName) { await database.insertTimelineItems(instanceName, timelineName, updates) - let itemIdsToAdd = store.getForTimeline(instanceName, timelineName, 'itemIdsToAdd') - if (itemIdsToAdd && itemIdsToAdd.length) { + let itemIdsToAdd = store.getForTimeline(instanceName, timelineName, 'itemIdsToAdd') || [] + if (updates && updates.length) { itemIdsToAdd = itemIdsToAdd.concat(updates.map(_ => _.id)) store.setForTimeline(instanceName, timelineName, {itemIdsToAdd: itemIdsToAdd}) }