mirror of https://github.com/vector-im/riot-web
Refresh the room list only if validation failed
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>pull/21833/head
parent
84b00b5c38
commit
6dcf860181
|
@ -138,12 +138,17 @@ export default class RoomDirectory extends React.Component<IProps, IState> {
|
||||||
instanceId = lsInstanceId;
|
instanceId = lsInstanceId;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.setState({
|
// Refresh the room list only if validation failed and we had to change these
|
||||||
protocolsLoading: false,
|
if (this.state.instanceId !== instanceId || this.state.roomServer !== roomServer) {
|
||||||
instanceId,
|
this.setState({
|
||||||
roomServer,
|
protocolsLoading: false,
|
||||||
});
|
instanceId,
|
||||||
this.refreshRoomList();
|
roomServer,
|
||||||
|
});
|
||||||
|
this.refreshRoomList();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.setState({ protocolsLoading: false });
|
||||||
}, (err) => {
|
}, (err) => {
|
||||||
console.warn(`error loading third party protocols: ${err}`);
|
console.warn(`error loading third party protocols: ${err}`);
|
||||||
this.setState({ protocolsLoading: false });
|
this.setState({ protocolsLoading: false });
|
||||||
|
@ -177,8 +182,8 @@ export default class RoomDirectory extends React.Component<IProps, IState> {
|
||||||
publicRooms: [],
|
publicRooms: [],
|
||||||
loading: true,
|
loading: true,
|
||||||
error: null,
|
error: null,
|
||||||
instanceId: null,
|
instanceId: localStorage.getItem(LAST_INSTANCE_KEY),
|
||||||
roomServer: null,
|
roomServer: localStorage.getItem(LAST_SERVER_KEY),
|
||||||
filterString: this.props.initialText || "",
|
filterString: this.props.initialText || "",
|
||||||
selectedCommunityId,
|
selectedCommunityId,
|
||||||
communityName: null,
|
communityName: null,
|
||||||
|
|
Loading…
Reference in New Issue