mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-23 18:05:59 +03:00
only reverting to the combined sign in/sign up screen when the currently login mode isn't supported
- eg for a SSO only flow or unknown/unsupported
This commit is contained in:
parent
49761382c6
commit
69c05e63d4
1 changed files with 11 additions and 1 deletions
|
@ -852,7 +852,7 @@ class OnboardingViewModel @AssistedInject constructor(
|
|||
}
|
||||
|
||||
withState {
|
||||
if (it.serverType == ServerType.MatrixOrg) {
|
||||
if (loginMode.supportsSignModeScreen()) {
|
||||
when (it.onboardingFlow) {
|
||||
OnboardingFlow.SignIn -> handleUpdateSignMode(OnboardingAction.UpdateSignMode(SignMode.SignIn))
|
||||
OnboardingFlow.SignUp -> handleUpdateSignMode(OnboardingAction.UpdateSignMode(SignMode.SignUp))
|
||||
|
@ -880,3 +880,13 @@ class OnboardingViewModel @AssistedInject constructor(
|
|||
return authenticationService.getFallbackUrl(forSignIn, deviceId)
|
||||
}
|
||||
}
|
||||
|
||||
private fun LoginMode.supportsSignModeScreen(): Boolean {
|
||||
return when (this) {
|
||||
LoginMode.Password,
|
||||
is LoginMode.SsoAndPassword -> true
|
||||
is LoginMode.Sso,
|
||||
LoginMode.Unknown,
|
||||
LoginMode.Unsupported -> false
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue