Merge pull request #4881 from matrix-org/travis/room-list/enable-default
Enable the new room list by default and trigger an initial render
This commit is contained in:
commit
cc23f23f19
2 changed files with 19 additions and 12 deletions
|
@ -166,8 +166,16 @@ export default class RoomList2 extends React.Component<IProps, IState> {
|
|||
}
|
||||
|
||||
public componentDidMount(): void {
|
||||
RoomListStore.instance.on(LISTS_UPDATE_EVENT, (store: RoomListStore2) => {
|
||||
const newLists = store.orderedLists;
|
||||
RoomListStore.instance.on(LISTS_UPDATE_EVENT, this.updateLists);
|
||||
this.updateLists(); // trigger the first update
|
||||
}
|
||||
|
||||
public componentWillUnmount() {
|
||||
RoomListStore.instance.off(LISTS_UPDATE_EVENT, this.updateLists);
|
||||
}
|
||||
|
||||
private updateLists = () => {
|
||||
const newLists = RoomListStore.instance.orderedLists;
|
||||
console.log("new lists", newLists);
|
||||
|
||||
const layoutMap = new Map<TagID, ListLayout>();
|
||||
|
@ -176,8 +184,7 @@ export default class RoomList2 extends React.Component<IProps, IState> {
|
|||
}
|
||||
|
||||
this.setState({sublists: newLists, layouts: layoutMap});
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
private renderCommunityInvites(): React.ReactElement[] {
|
||||
// TODO: Put community invites in a more sensible place (not in the room list)
|
||||
|
|
|
@ -150,7 +150,7 @@ export const SETTINGS = {
|
|||
isFeature: true,
|
||||
displayName: _td("Use the improved room list (will refresh to apply changes)"),
|
||||
supportedLevels: LEVELS_FEATURE,
|
||||
default: false,
|
||||
default: true,
|
||||
controller: new ReloadOnChangeController(),
|
||||
},
|
||||
"feature_custom_themes": {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue