Be consistent with other stores

pull/21833/head
Travis Ralston 2020-07-08 18:36:56 -06:00
parent c8f90be81d
commit 62b4596c04
1 changed files with 7 additions and 7 deletions

View File

@ -31,6 +31,13 @@ export default class RoomListLayoutStore extends AsyncStoreWithClient<IState> {
super(defaultDispatcher); super(defaultDispatcher);
} }
public static get instance(): RoomListLayoutStore {
if (!RoomListLayoutStore.internalInstance) {
RoomListLayoutStore.internalInstance = new RoomListLayoutStore();
}
return RoomListLayoutStore.internalInstance;
}
public ensureLayoutExists(tagId: TagID) { public ensureLayoutExists(tagId: TagID) {
if (!this.layoutMap.has(tagId)) { if (!this.layoutMap.has(tagId)) {
this.layoutMap.set(tagId, new ListLayout(tagId)); this.layoutMap.set(tagId, new ListLayout(tagId));
@ -52,13 +59,6 @@ export default class RoomListLayoutStore extends AsyncStoreWithClient<IState> {
} }
} }
public static get instance(): RoomListLayoutStore {
if (!RoomListLayoutStore.internalInstance) {
RoomListLayoutStore.internalInstance = new RoomListLayoutStore();
}
return RoomListLayoutStore.internalInstance;
}
protected async onNotReady(): Promise<any> { protected async onNotReady(): Promise<any> {
// On logout, clear the map. // On logout, clear the map.
this.layoutMap.clear(); this.layoutMap.clear();