From a17b2ba1e559bb9f35764be8ec6097ff27f3da47 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Tue, 8 Sep 2020 17:38:13 +0100 Subject: [PATCH] use constant --- src/stores/WidgetStore.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/stores/WidgetStore.ts b/src/stores/WidgetStore.ts index d29ee81e13..c01d77855c 100644 --- a/src/stores/WidgetStore.ts +++ b/src/stores/WidgetStore.ts @@ -25,6 +25,7 @@ import WidgetEchoStore from "../stores/WidgetEchoStore"; import WidgetUtils from "../utils/WidgetUtils"; import {SettingLevel} from "../settings/SettingLevel"; import {WidgetType} from "../widgets/WidgetType"; +import {UPDATE_EVENT} from "./AsyncStore"; interface IState {} @@ -87,7 +88,7 @@ export default class WidgetStore extends AsyncStoreWithClient { this.loadRoomWidgets(room); }); - this.emit("update"); + this.emit(UPDATE_EVENT); } protected async onNotReady(): Promise { @@ -105,7 +106,7 @@ export default class WidgetStore extends AsyncStoreWithClient { private onWidgetEchoStoreUpdate(roomId: string, widgetId: string) { this.initRoom(roomId); this.loadRoomWidgets(this.matrixClient.getRoom(roomId)); - this.emit("update"); + this.emit(UPDATE_EVENT); } private generateApps(room: Room): IApp[] { @@ -131,7 +132,7 @@ export default class WidgetStore extends AsyncStoreWithClient { const roomId = ev.getRoomId(); this.initRoom(roomId); this.loadRoomWidgets(this.matrixClient.getRoom(roomId)); - this.emit("update"); + this.emit(UPDATE_EVENT); } public getRoomId = (widgetId: string) => { @@ -148,7 +149,7 @@ export default class WidgetStore extends AsyncStoreWithClient { this.initRoom(roomId); this.getRoom(roomId).pinned = SettingsStore.getValue(settingName, roomId); this.emit(roomId); - this.emit("update"); + this.emit(UPDATE_EVENT); }; public isPinned(widgetId: string) { @@ -192,7 +193,7 @@ export default class WidgetStore extends AsyncStoreWithClient { SettingsStore.setValue("Widgets.pinned", roomId, SettingLevel.ROOM_ACCOUNT, roomInfo.pinned); this.emit(roomId); - this.emit("update"); + this.emit(UPDATE_EVENT); } public getApps(room: Room, pinned?: boolean): IApp[] {