mirror of https://github.com/vector-im/riot-web
Be consistent with other stores
parent
c8f90be81d
commit
62b4596c04
|
@ -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();
|
||||||
|
|
Loading…
Reference in New Issue