Split loading & connecting messages

This commit is contained in:
Ingvar Stepanyan
2022-02-09 13:16:52 +00:00
parent 43adb595c7
commit 6bad06e549

View File

@@ -60,6 +60,7 @@ class App extends Component {
);
// Try to connect to camera at startup.
// If none is found among saved connections, it will fallback to a picker.
this.setState({ type: 'Status', message: '⌛ Loading...' });
this.tryToConnectToCamera();
}
@@ -73,11 +74,11 @@ class App extends Component {
}
]
});
this.setState({ type: 'Status', message: '⌛ Connecting...' });
await this.tryToConnectToCamera();
};
async tryToConnectToCamera() {
this.setState({ type: 'Status', message: 'Connecting...' });
try {
this.connection = await connect();
} catch (e) {