mirror of
https://github.com/element-hq/element-android
synced 2024-11-28 05:31:21 +03:00
adding back sign mode setting to fix crash when using legacy other flow
This commit is contained in:
parent
be22be53df
commit
55c981f18b
1 changed files with 13 additions and 8 deletions
|
@ -349,12 +349,7 @@ class OnboardingViewModel @AssistedInject constructor(
|
|||
}
|
||||
|
||||
private fun handleUpdateSignMode(action: OnboardingAction.UpdateSignMode) {
|
||||
setState {
|
||||
copy(
|
||||
signMode = action.signMode
|
||||
)
|
||||
}
|
||||
|
||||
updateSignMode(action.signMode)
|
||||
when (action.signMode) {
|
||||
SignMode.SignUp -> handleRegisterAction(RegisterAction.StartRegistration, ::emitFlowResultViewEvent)
|
||||
SignMode.SignIn -> startAuthenticationFlow()
|
||||
|
@ -363,6 +358,10 @@ class OnboardingViewModel @AssistedInject constructor(
|
|||
}
|
||||
}
|
||||
|
||||
private fun updateSignMode(signMode: SignMode) {
|
||||
setState { copy(signMode = signMode) }
|
||||
}
|
||||
|
||||
private fun handleUpdateUseCase(action: OnboardingAction.UpdateUseCase) {
|
||||
setState { copy(useCase = action.useCase) }
|
||||
when (vectorFeatures.isOnboardingCombinedRegisterEnabled()) {
|
||||
|
@ -644,8 +643,14 @@ class OnboardingViewModel @AssistedInject constructor(
|
|||
updateServerSelection(config, serverTypeOverride, authResult)
|
||||
if (authResult.selectedHomeserver.preferredLoginMode.supportsSignModeScreen()) {
|
||||
when (awaitState().onboardingFlow) {
|
||||
OnboardingFlow.SignIn -> internalRegisterAction(RegisterAction.StartRegistration, ::emitFlowResultViewEvent)
|
||||
OnboardingFlow.SignUp -> internalRegisterAction(RegisterAction.StartRegistration, ::emitFlowResultViewEvent)
|
||||
OnboardingFlow.SignIn -> {
|
||||
updateSignMode(SignMode.SignIn)
|
||||
internalRegisterAction(RegisterAction.StartRegistration, ::emitFlowResultViewEvent)
|
||||
}
|
||||
OnboardingFlow.SignUp -> {
|
||||
updateSignMode(SignMode.SignUp)
|
||||
internalRegisterAction(RegisterAction.StartRegistration, ::emitFlowResultViewEvent)
|
||||
}
|
||||
OnboardingFlow.SignInSignUp,
|
||||
null -> {
|
||||
_viewEvents.post(OnboardingViewEvents.OnLoginFlowRetrieved)
|
||||
|
|
Loading…
Reference in a new issue