mirror of
https://github.com/Novaloop-AG/healthchat-web.git
synced 2026-11-10 18:29:03 +00:00
comments
This commit is contained in:
@@ -66,11 +66,14 @@ class WidgetEchoStore extends EventEmitter {
|
|||||||
roomHasPendingWidgetsOfType(roomId, currentRoomWidgets, type) {
|
roomHasPendingWidgetsOfType(roomId, currentRoomWidgets, type) {
|
||||||
const roomEchoState = Object.assign({}, this._roomWidgetEcho[roomId]);
|
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) {
|
for (const w of currentRoomWidgets) {
|
||||||
const widgetId = w.getStateKey();
|
const widgetId = w.getStateKey();
|
||||||
delete roomEchoState[widgetId];
|
delete roomEchoState[widgetId];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if there's anything left then there are pending widgets.
|
||||||
if (type === undefined) {
|
if (type === undefined) {
|
||||||
return Object.keys(roomEchoState).length > 0;
|
return Object.keys(roomEchoState).length > 0;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user