mirror of
https://github.com/element-hq/element-web
synced 2024-11-28 12:28:50 +03:00
Fix setState() usage in the constructor of RoomDirectory
React doesn't like it when we setState() in the constructor
This commit is contained in:
parent
4db9ac16b5
commit
815a1559ff
1 changed files with 5 additions and 3 deletions
|
@ -70,10 +70,10 @@ export default class RoomDirectory extends React.Component {
|
|||
this.scrollPanel = null;
|
||||
this.protocols = null;
|
||||
|
||||
this.setState({protocolsLoading: true});
|
||||
this.state.protocolsLoading = true;
|
||||
if (!MatrixClientPeg.get()) {
|
||||
// We may not have a client yet when invoked from welcome page
|
||||
this.setState({protocolsLoading: false});
|
||||
this.state.protocolsLoading = false;
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -102,14 +102,16 @@ export default class RoomDirectory extends React.Component {
|
|||
});
|
||||
} else {
|
||||
// We don't use the protocols in the communities v2 prototype experience
|
||||
this.setState({protocolsLoading: false});
|
||||
this.state.protocolsLoading = false;
|
||||
|
||||
// Grab the profile info async
|
||||
FlairStore.getGroupProfileCached(MatrixClientPeg.get(), this.state.selectedCommunityId).then(profile => {
|
||||
this.setState({communityName: profile.name});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
this.refreshRoomList();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue