mirror of
https://github.com/element-hq/element-web.git
synced 2024-11-30 07:53:31 +03:00
Don't rely on React being fast
This commit is contained in:
parent
c6a18b11f0
commit
2bc0e8e151
1 changed files with 5 additions and 5 deletions
|
@ -149,6 +149,7 @@ module.exports = React.createClass({
|
|||
if (!this.state.serverIsAlive) {
|
||||
this.setState({busy: true});
|
||||
// Do a quick liveliness check on the URLs
|
||||
let aliveAgain = true;
|
||||
try {
|
||||
await AutoDiscoveryUtils.validateServerConfigWithStaticUrls(
|
||||
this.props.serverConfig.hsUrl,
|
||||
|
@ -156,17 +157,16 @@ module.exports = React.createClass({
|
|||
);
|
||||
this.setState({serverIsAlive: true, errorText: ""});
|
||||
} catch (e) {
|
||||
const componentState = AutoDiscoveryUtils.authComponentStateForError(e);
|
||||
this.setState({
|
||||
busy: false,
|
||||
...AutoDiscoveryUtils.authComponentStateForError(e),
|
||||
...componentState,
|
||||
});
|
||||
if (this.state.serverErrorIsFatal) {
|
||||
return; // Server is dead - do not continue.
|
||||
}
|
||||
aliveAgain = !componentState.serverErrorIsFatal;
|
||||
}
|
||||
|
||||
// Prevent people from submitting their password when something isn't right.
|
||||
if (!this.state.serverIsAlive) {
|
||||
if (!aliveAgain) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue