From 84b68308b9c9d0401b8e10513897b4596bac8637 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Mon, 12 Sep 2022 13:42:44 +0200 Subject: [PATCH] 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. --- components/app.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/components/app.js b/components/app.js index 1568565..5c2b76f 100644 --- a/components/app.js +++ b/components/app.js @@ -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 });