fixing onboarding crash when signing in/up with sso -

handles the sso flows by not forwarding to the signin/signup pages and instead using the previous onLoginFlowRetrieved when the selected server type is other
This commit is contained in:
Adam Brown 2022-01-18 10:29:26 +00:00
parent f5b16b834c
commit 114c60cfed
1 changed files with 10 additions and 6 deletions

View File

@ -826,13 +826,17 @@ class OnboardingViewModel @AssistedInject constructor(
}
withState {
when (it.onboardingFlow) {
OnboardingFlow.SignIn -> handleUpdateSignMode(OnboardingAction.UpdateSignMode(SignMode.SignIn))
OnboardingFlow.SignUp -> handleUpdateSignMode(OnboardingAction.UpdateSignMode(SignMode.SignUp))
OnboardingFlow.SignInSignUp,
null -> {
_viewEvents.post(OnboardingViewEvents.OnLoginFlowRetrieved)
if (it.serverType == ServerType.MatrixOrg) {
when (it.onboardingFlow) {
OnboardingFlow.SignIn -> handleUpdateSignMode(OnboardingAction.UpdateSignMode(SignMode.SignIn))
OnboardingFlow.SignUp -> handleUpdateSignMode(OnboardingAction.UpdateSignMode(SignMode.SignUp))
OnboardingFlow.SignInSignUp,
null -> {
_viewEvents.post(OnboardingViewEvents.OnLoginFlowRetrieved)
}
}
} else {
_viewEvents.post(OnboardingViewEvents.OnLoginFlowRetrieved)
}
}
}