From 7e2b559ccd9ca812d2c6e4955940016d044e067e Mon Sep 17 00:00:00 2001 From: David Baker Date: Thu, 5 Jul 2018 19:46:37 +0100 Subject: [PATCH] Make if clearer --- src/stores/WidgetEchoStore.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/stores/WidgetEchoStore.js b/src/stores/WidgetEchoStore.js index 493eee7181..e4fc6d755a 100644 --- a/src/stores/WidgetEchoStore.js +++ b/src/stores/WidgetEchoStore.js @@ -51,12 +51,9 @@ class WidgetEchoStore extends EventEmitter { for (const w of currentRoomWidgets) { const widgetId = w.getStateKey(); - if (roomEchoState[widgetId] && Object.keys(roomEchoState[widgetId]).length === 0) { - // delete locally so don't copy it - // we don't include widgets that have changed for the same rason we don't include new ones, - // so fall into the 'else' case and use the old one - //} else if (roomEchoState && roomEchoState[widgetId]) { - // echoedWidgets.push(roomEchoState[widgetId]); + // If there's no echo, or the echo still has a widget present, show the *old* widget + // we don't include widgets that have changed for the same rason we don't include new ones + if (!roomEchoState[widgetId] || Object.keys(roomEchoState[widgetId]).length !== 0) { } else { echoedWidgets.push(w); }