mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-26 03:20:50 +02:00
MESSENGER-5130 hotfix maintenance popup on missing server
This commit is contained in:
+14
-9
@@ -17,6 +17,10 @@
|
||||
import SwiftUI
|
||||
import AVKit
|
||||
|
||||
enum AuthenticationServerSelectionScreenAlertType {
|
||||
case showServerMaintenanceInfoMessageAlert, showServerMaintenanceDefaultAlert, showInvalidAppVersionAlert, showDowntimeTimeAlert, showInvalidServerAlert
|
||||
}
|
||||
|
||||
struct AuthenticationServerSelectionScreen: View {
|
||||
// MARK: - Properties
|
||||
|
||||
@@ -35,7 +39,7 @@ struct AuthenticationServerSelectionScreen: View {
|
||||
// bwi #4976 show maintenance alert
|
||||
@State private var isFetchingDowntime = false
|
||||
@State private var showAlert = false
|
||||
@State private var activeAlert: OnBoardingSplashScreenAlertType = .showInvalidAppVersionAlert
|
||||
@State private var activeAlert: AuthenticationServerSelectionScreenAlertType = .showInvalidAppVersionAlert
|
||||
|
||||
private var textFieldFooterColor: Color {
|
||||
viewModel.viewState.hasValidationError ? theme.colors.alert : theme.colors.tertiaryContent
|
||||
@@ -68,9 +72,7 @@ struct AuthenticationServerSelectionScreen: View {
|
||||
|
||||
serverForm
|
||||
.alert(item: $viewModel.alertInfo) { $0.alert }
|
||||
.alert(isPresented: $showAlertForInvalidServer) {
|
||||
invalidServerAlert()
|
||||
}
|
||||
|
||||
if BWIBuildSettings.shared.authScreenShowTestServerOptions {
|
||||
serverSelectionButton
|
||||
}
|
||||
@@ -153,8 +155,10 @@ struct AuthenticationServerSelectionScreen: View {
|
||||
return Alert(title: Text(BWIL10n.downtimeTitle),
|
||||
message: Text(BWIL10n.downtimeDefaultMessage),
|
||||
dismissButton: .destructive(Text(BWIL10n.downtimeAlertDismissButton)) {
|
||||
self.submit()
|
||||
})
|
||||
self.submit()
|
||||
})
|
||||
case .showInvalidServerAlert:
|
||||
return self.invalidServerAlert()
|
||||
}
|
||||
})
|
||||
|
||||
@@ -270,7 +274,8 @@ struct AuthenticationServerSelectionScreen: View {
|
||||
if isHomeserverAddressValid(viewModel.homeserverAddress) {
|
||||
viewModel.send(viewAction: .confirm)
|
||||
} else {
|
||||
showAlertForInvalidServer = true
|
||||
activeAlert = .showInvalidServerAlert
|
||||
showAlert = true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -345,8 +350,8 @@ struct AuthenticationServerSelectionScreen: View {
|
||||
if success {
|
||||
self.showAlertIfNeeded()
|
||||
} else {
|
||||
showAlert = true
|
||||
activeAlert = .showServerMaintenanceDefaultAlert
|
||||
// hotfix 2.9.1 if request ist no successful there probably is no maintenance on server -> don't show popup
|
||||
self.submit()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user