From 658ac73064227f21eaf9b3037a3c402ba3846c31 Mon Sep 17 00:00:00 2001 From: David Baker Date: Thu, 5 Jul 2018 19:57:24 +0100 Subject: [PATCH] comments --- src/stores/WidgetEchoStore.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/stores/WidgetEchoStore.js b/src/stores/WidgetEchoStore.js index 2710f0a9a1..cce404662e 100644 --- a/src/stores/WidgetEchoStore.js +++ b/src/stores/WidgetEchoStore.js @@ -66,11 +66,14 @@ class WidgetEchoStore extends EventEmitter { roomHasPendingWidgetsOfType(roomId, currentRoomWidgets, type) { const roomEchoState = Object.assign({}, this._roomWidgetEcho[roomId]); + // any widget IDs that are already in the room are not pending, so + // echoes for them don't count as pending. for (const w of currentRoomWidgets) { const widgetId = w.getStateKey(); delete roomEchoState[widgetId]; } + // if there's anything left then there are pending widgets. if (type === undefined) { return Object.keys(roomEchoState).length > 0; } else {