WidgetEchoStore improve update event to include roomId and widgetId

pull/21833/head
Michael Telatynski 2020-09-07 16:13:05 +01:00
parent 07f7ff6831
commit b75e2aa299
1 changed files with 2 additions and 2 deletions

View File

@ -93,13 +93,13 @@ class WidgetEchoStore extends EventEmitter {
if (this._roomWidgetEcho[roomId] === undefined) this._roomWidgetEcho[roomId] = {};
this._roomWidgetEcho[roomId][widgetId] = state;
this.emit('update');
this.emit('update', roomId, widgetId);
}
removeRoomWidgetEcho(roomId, widgetId) {
delete this._roomWidgetEcho[roomId][widgetId];
if (Object.keys(this._roomWidgetEcho[roomId]).length === 0) delete this._roomWidgetEcho[roomId];
this.emit('update');
this.emit('update', roomId, widgetId);
}
}