mirror of
https://github.com/Novaloop-AG/healthchat-web.git
synced 2026-11-06 22:48:21 +00:00
WidgetEchoStore improve update event to include roomId and widgetId
This commit is contained in:
@@ -93,13 +93,13 @@ class WidgetEchoStore extends EventEmitter {
|
|||||||
if (this._roomWidgetEcho[roomId] === undefined) this._roomWidgetEcho[roomId] = {};
|
if (this._roomWidgetEcho[roomId] === undefined) this._roomWidgetEcho[roomId] = {};
|
||||||
|
|
||||||
this._roomWidgetEcho[roomId][widgetId] = state;
|
this._roomWidgetEcho[roomId][widgetId] = state;
|
||||||
this.emit('update');
|
this.emit('update', roomId, widgetId);
|
||||||
}
|
}
|
||||||
|
|
||||||
removeRoomWidgetEcho(roomId, widgetId) {
|
removeRoomWidgetEcho(roomId, widgetId) {
|
||||||
delete this._roomWidgetEcho[roomId][widgetId];
|
delete this._roomWidgetEcho[roomId][widgetId];
|
||||||
if (Object.keys(this._roomWidgetEcho[roomId]).length === 0) delete this._roomWidgetEcho[roomId];
|
if (Object.keys(this._roomWidgetEcho[roomId]).length === 0) delete this._roomWidgetEcho[roomId];
|
||||||
this.emit('update');
|
this.emit('update', roomId, widgetId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user