Try to reduce WidgetStore causing downstream problems

This commit is contained in:
Travis Ralston 2021-01-20 14:44:30 -07:00
parent f8fe454c59
commit 29780d902c
2 changed files with 14 additions and 5 deletions

View file

@ -76,7 +76,7 @@ export default class WidgetStore extends AsyncStoreWithClient<IState> {
this.matrixClient.getRooms().forEach((room: Room) => {
this.loadRoomWidgets(room);
});
this.emit(UPDATE_EVENT);
this.emit(UPDATE_EVENT, null); // emit for all rooms
}
protected async onNotReady(): Promise<any> {
@ -94,7 +94,7 @@ export default class WidgetStore extends AsyncStoreWithClient<IState> {
private onWidgetEchoStoreUpdate = (roomId: string, widgetId: string) => {
this.initRoom(roomId);
this.loadRoomWidgets(this.matrixClient.getRoom(roomId));
this.emit(UPDATE_EVENT);
this.emit(UPDATE_EVENT, roomId);
};
private generateApps(room: Room): IApp[] {
@ -143,7 +143,7 @@ export default class WidgetStore extends AsyncStoreWithClient<IState> {
const roomId = ev.getRoomId();
this.initRoom(roomId);
this.loadRoomWidgets(this.matrixClient.getRoom(roomId));
this.emit(UPDATE_EVENT);
this.emit(UPDATE_EVENT, roomId);
};
public getRoom = (roomId: string) => {