mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-27 12:00:03 +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 {
|
withState {
|
||||||
if (it.serverType == ServerType.MatrixOrg) {
|
if (loginMode.supportsSignModeScreen()) {
|
||||||
when (it.onboardingFlow) {
|
when (it.onboardingFlow) {
|
||||||
OnboardingFlow.SignIn -> handleUpdateSignMode(OnboardingAction.UpdateSignMode(SignMode.SignIn))
|
OnboardingFlow.SignIn -> handleUpdateSignMode(OnboardingAction.UpdateSignMode(SignMode.SignIn))
|
||||||
OnboardingFlow.SignUp -> handleUpdateSignMode(OnboardingAction.UpdateSignMode(SignMode.SignUp))
|
OnboardingFlow.SignUp -> handleUpdateSignMode(OnboardingAction.UpdateSignMode(SignMode.SignUp))
|
||||||
|
@ -880,3 +880,13 @@ class OnboardingViewModel @AssistedInject constructor(
|
||||||
return authenticationService.getFallbackUrl(forSignIn, deviceId)
|
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