mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-12-28 18:41:43 +01:00
adding back sign mode setting to fix crash when using legacy other flow
This commit is contained in:
parent
be22be53df
commit
55c981f18b
@ -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 New Issue
Block a user