mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-18 15:38:28 +02:00
Show fallback on login screen
This commit is contained in:
@@ -61,6 +61,10 @@ struct AuthenticationLoginScreen: View {
|
||||
ssoButtons
|
||||
.padding(.top, 16)
|
||||
}
|
||||
|
||||
if !viewModel.viewState.homeserver.showLoginForm && !viewModel.viewState.showSSOButtons {
|
||||
fallbackButton
|
||||
}
|
||||
|
||||
}
|
||||
.readableFrame()
|
||||
@@ -137,6 +141,15 @@ struct AuthenticationLoginScreen: View {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// A fallback button that can be used for login.
|
||||
var fallbackButton: some View {
|
||||
Button(action: fallback) {
|
||||
Text(VectorL10n.login)
|
||||
}
|
||||
.buttonStyle(PrimaryActionButtonStyle())
|
||||
.accessibilityIdentifier("fallbackButton")
|
||||
}
|
||||
|
||||
/// Give focus to the password text field.
|
||||
func usernameEditingChanged(isEditing: Bool) {
|
||||
@@ -158,6 +171,11 @@ struct AuthenticationLoginScreen: View {
|
||||
guard viewModel.viewState.hasValidCredentials else { return }
|
||||
viewModel.send(viewAction: .next)
|
||||
}
|
||||
|
||||
/// Sends the `fallback` view action.
|
||||
func fallback() {
|
||||
viewModel.send(viewAction: .fallback)
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Previews
|
||||
|
||||
Reference in New Issue
Block a user