fix wifi modals

This commit is contained in:
2024-03-29 04:01:08 +01:00
parent 9831046592
commit db394ea201
2 changed files with 8 additions and 38 deletions

View File

@ -23,7 +23,6 @@ interface StartupState {
showStartBtn: boolean,
isConnected: boolean,
isConnectionIssue: boolean,
openWifiQuestion: boolean,
startCounter: number,
}
@ -36,7 +35,6 @@ export default class Startup extends Component<{}, StartupState> {
showStartBtn: false,
isConnected: false,
isConnectionIssue: false,
openWifiQuestion: false,
startCounter: 10,
};
}
@ -50,7 +48,7 @@ export default class Startup extends Component<{}, StartupState> {
openCloudConnectModal: true,
statusTxt: "Möchten Sie CloudConnect+ nutzen?"
}));
this.cloudDecision(true).then();
//this.cloudDecision(true).then();
}, 1)
}
@ -88,7 +86,6 @@ export default class Startup extends Component<{}, StartupState> {
async cloudDecision(decision: boolean) {
this.setState((prevState) => ({
...prevState,
openWifiQuestion: false,
openCloudConnectModal: false,
isConnectionIssue: false,
isConnected: false,
@ -107,8 +104,8 @@ export default class Startup extends Component<{}, StartupState> {
if (!status.hasInternet) {
this.setState((prevState) => ({
...prevState,
openWifiQuestion: true, // Weiterleiten auf WiFiFrage
statusTxt: "Warten auf Netzwerkkonfiguration..."
isConnectionIssue: true, // Weiterleiten auf Fehlermodal
statusTxt: "Warten auf Netzwerk..."
}));
} else {
this.setState((prevState) => ({
@ -161,31 +158,6 @@ export default class Startup extends Component<{}, StartupState> {
render() {
return <div className="startup">
<Dialog
open={this.state.openWifiQuestion}
onClose={null}
aria-labelledby="alert-dialog-title"
aria-describedby="alert-dialog-description"
>
<DialogTitle id="alert-dialog-title">
Keine Internetverbindung!
</DialogTitle>
<DialogContent>
<DialogContentText id="alert-dialog-description">
Es wurde keine Internetverbindung erkannt.<br/><br/>
<strong>Möchten Sie eine WLAN-Verbindung einrichten?</strong>
<br/><i>Andernfalls können Sie SmartMonopoly offline nutzen.</i>
</DialogContentText>
</DialogContent>
<DialogActions>
<Button onClick={() => this.cloudDecision(false)}>
Offline nutzen
</Button>
<Button onClick={() => {
window.app.toggleWiFiSettings(true)
}} autoFocus>Einrichten</Button>
</DialogActions>
</Dialog>
<Dialog
open={this.state.isConnectionIssue}
onClose={null}