You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-08 21:42:24 +03:00
Fix stacktrace when starting riot up with rooms
Settings can trigger before we're ready, so don't generate the room list. This also includes a comment to signify to future people that we need to track settings still.
This commit is contained in:
@@ -133,6 +133,8 @@ class RoomListStore extends Store {
|
|||||||
const logicallyReady = this._matrixClient && this._state.ready;
|
const logicallyReady = this._matrixClient && this._state.ready;
|
||||||
switch (payload.action) {
|
switch (payload.action) {
|
||||||
case 'setting_updated': {
|
case 'setting_updated': {
|
||||||
|
if (!logicallyReady) break;
|
||||||
|
|
||||||
if (payload.settingName === 'RoomList.orderByImportance') {
|
if (payload.settingName === 'RoomList.orderByImportance') {
|
||||||
this.updateSortingAlgorithm(payload.newValue === true ? ALGO_IMPORTANCE : ALGO_RECENT);
|
this.updateSortingAlgorithm(payload.newValue === true ? ALGO_IMPORTANCE : ALGO_RECENT);
|
||||||
} else if (payload.settingName === 'feature_custom_tags') {
|
} else if (payload.settingName === 'feature_custom_tags') {
|
||||||
@@ -147,6 +149,10 @@ class RoomListStore extends Store {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Always ensure that we set any state needed for settings here. It is possible that
|
||||||
|
// setting updates trigger on startup before we are ready to sync, so we want to make
|
||||||
|
// sure that the right state is in place before we actually react to those changes.
|
||||||
|
|
||||||
this._setState({tagsEnabled: SettingsStore.isFeatureEnabled("feature_custom_tags")});
|
this._setState({tagsEnabled: SettingsStore.isFeatureEnabled("feature_custom_tags")});
|
||||||
|
|
||||||
this._matrixClient = payload.matrixClient;
|
this._matrixClient = payload.matrixClient;
|
||||||
|
|||||||
Reference in New Issue
Block a user