From 114c60cfedc1d32c9042ed95d2f50c8c70ff2052 Mon Sep 17 00:00:00 2001 From: Adam Brown Date: Tue, 18 Jan 2022 10:29:26 +0000 Subject: [PATCH] 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 --- .../features/onboarding/OnboardingViewModel.kt | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/vector/src/main/java/im/vector/app/features/onboarding/OnboardingViewModel.kt b/vector/src/main/java/im/vector/app/features/onboarding/OnboardingViewModel.kt index 5d1e0fdade..4b3ce14002 100644 --- a/vector/src/main/java/im/vector/app/features/onboarding/OnboardingViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/onboarding/OnboardingViewModel.kt @@ -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) } } }