mirror of
https://github.com/element-hq/element-web
synced 2024-11-27 11:47:23 +03:00
Merge pull request #6287 from matrix-org/gsouquet/fix-17836
Avoid cyclic dependencies by moving watchers out of constructor
This commit is contained in:
commit
55121f6e81
1 changed files with 6 additions and 7 deletions
|
@ -73,13 +73,6 @@ export class RoomListStoreClass extends AsyncStoreWithClient<IState> {
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
super(defaultDispatcher);
|
super(defaultDispatcher);
|
||||||
|
|
||||||
this.checkLoggingEnabled();
|
|
||||||
for (const settingName of this.watchedSettings) SettingsStore.monitorSetting(settingName, null);
|
|
||||||
RoomViewStore.addListener(() => this.handleRVSUpdate({}));
|
|
||||||
this.algorithm.on(LIST_UPDATED_EVENT, this.onAlgorithmListUpdated);
|
|
||||||
this.algorithm.on(FILTER_CHANGED, this.onAlgorithmFilterUpdated);
|
|
||||||
this.setupWatchers();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private setupWatchers() {
|
private setupWatchers() {
|
||||||
|
@ -127,6 +120,12 @@ export class RoomListStoreClass extends AsyncStoreWithClient<IState> {
|
||||||
|
|
||||||
this.checkLoggingEnabled();
|
this.checkLoggingEnabled();
|
||||||
|
|
||||||
|
for (const settingName of this.watchedSettings) SettingsStore.monitorSetting(settingName, null);
|
||||||
|
RoomViewStore.addListener(() => this.handleRVSUpdate({}));
|
||||||
|
this.algorithm.on(LIST_UPDATED_EVENT, this.onAlgorithmListUpdated);
|
||||||
|
this.algorithm.on(FILTER_CHANGED, this.onAlgorithmFilterUpdated);
|
||||||
|
this.setupWatchers();
|
||||||
|
|
||||||
// Update any settings here, as some may have happened before we were logically ready.
|
// Update any settings here, as some may have happened before we were logically ready.
|
||||||
// Update any settings here, as some may have happened before we were logically ready.
|
// Update any settings here, as some may have happened before we were logically ready.
|
||||||
console.log("Regenerating room lists: Startup");
|
console.log("Regenerating room lists: Startup");
|
||||||
|
|
Loading…
Reference in a new issue