use constant

pull/21833/head
Michael Telatynski 2020-09-08 17:38:13 +01:00
parent 1532048f33
commit a17b2ba1e5
1 changed files with 6 additions and 5 deletions

View File

@ -25,6 +25,7 @@ import WidgetEchoStore from "../stores/WidgetEchoStore";
import WidgetUtils from "../utils/WidgetUtils"; import WidgetUtils from "../utils/WidgetUtils";
import {SettingLevel} from "../settings/SettingLevel"; import {SettingLevel} from "../settings/SettingLevel";
import {WidgetType} from "../widgets/WidgetType"; import {WidgetType} from "../widgets/WidgetType";
import {UPDATE_EVENT} from "./AsyncStore";
interface IState {} interface IState {}
@ -87,7 +88,7 @@ export default class WidgetStore extends AsyncStoreWithClient<IState> {
this.loadRoomWidgets(room); this.loadRoomWidgets(room);
}); });
this.emit("update"); this.emit(UPDATE_EVENT);
} }
protected async onNotReady(): Promise<any> { protected async onNotReady(): Promise<any> {
@ -105,7 +106,7 @@ export default class WidgetStore extends AsyncStoreWithClient<IState> {
private onWidgetEchoStoreUpdate(roomId: string, widgetId: string) { private onWidgetEchoStoreUpdate(roomId: string, widgetId: string) {
this.initRoom(roomId); this.initRoom(roomId);
this.loadRoomWidgets(this.matrixClient.getRoom(roomId)); this.loadRoomWidgets(this.matrixClient.getRoom(roomId));
this.emit("update"); this.emit(UPDATE_EVENT);
} }
private generateApps(room: Room): IApp[] { private generateApps(room: Room): IApp[] {
@ -131,7 +132,7 @@ export default class WidgetStore extends AsyncStoreWithClient<IState> {
const roomId = ev.getRoomId(); const roomId = ev.getRoomId();
this.initRoom(roomId); this.initRoom(roomId);
this.loadRoomWidgets(this.matrixClient.getRoom(roomId)); this.loadRoomWidgets(this.matrixClient.getRoom(roomId));
this.emit("update"); this.emit(UPDATE_EVENT);
} }
public getRoomId = (widgetId: string) => { public getRoomId = (widgetId: string) => {
@ -148,7 +149,7 @@ export default class WidgetStore extends AsyncStoreWithClient<IState> {
this.initRoom(roomId); this.initRoom(roomId);
this.getRoom(roomId).pinned = SettingsStore.getValue(settingName, roomId); this.getRoom(roomId).pinned = SettingsStore.getValue(settingName, roomId);
this.emit(roomId); this.emit(roomId);
this.emit("update"); this.emit(UPDATE_EVENT);
}; };
public isPinned(widgetId: string) { public isPinned(widgetId: string) {
@ -192,7 +193,7 @@ export default class WidgetStore extends AsyncStoreWithClient<IState> {
SettingsStore.setValue("Widgets.pinned", roomId, SettingLevel.ROOM_ACCOUNT, roomInfo.pinned); SettingsStore.setValue("Widgets.pinned", roomId, SettingLevel.ROOM_ACCOUNT, roomInfo.pinned);
this.emit(roomId); this.emit(roomId);
this.emit("update"); this.emit(UPDATE_EVENT);
} }
public getApps(room: Room, pinned?: boolean): IApp[] { public getApps(room: Room, pinned?: boolean): IApp[] {