forked from CringeStudios/gamja
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:
parent
4964782c30
commit
84b68308b9
@ -250,8 +250,6 @@ export default class App extends Component {
|
|||||||
* done in fillConnectParams)
|
* done in fillConnectParams)
|
||||||
*/
|
*/
|
||||||
handleConfig(config) {
|
handleConfig(config) {
|
||||||
this.setState({ loading: false });
|
|
||||||
|
|
||||||
let connectParams = { ...this.state.connectParams };
|
let connectParams = { ...this.state.connectParams };
|
||||||
|
|
||||||
if (typeof config.server.url === "string") {
|
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) {
|
if (connectParams.autoconnect) {
|
||||||
this.setState({ connectForm: false });
|
this.setState({ connectForm: false });
|
||||||
|
Loading…
x
Reference in New Issue
Block a user