components/app: switch off loading state atomically

Set connectParams together with loading, to avoid intermediate
state where loading = false but connectParams isn't set yet.
This commit is contained in:
Simon Ser 2022-09-12 13:42:44 +02:00
parent 4964782c30
commit 84b68308b9

View file

@ -250,8 +250,6 @@ export default class App extends Component {
* done in fillConnectParams)
*/
handleConfig(config) {
this.setState({ loading: false });
let connectParams = { ...this.state.connectParams };
if (typeof config.server.url === "string") {
@ -341,7 +339,7 @@ export default class App extends Component {
}
}
this.setState({ connectParams: connectParams });
this.setState({ loading: false, connectParams: connectParams });
if (connectParams.autoconnect) {
this.setState({ connectForm: false });