ensure the pid add/resend methods do not trigger the next registration steps
- keeps the previous behaviour
This commit is contained in:
parent
3fa415007c
commit
434ee67982
|
@ -276,9 +276,14 @@ class OnboardingViewModel @AssistedInject constructor(
|
|||
kotlin.runCatching { registrationActionHandler.handleRegisterAction(registrationWizard, action) }
|
||||
.fold(
|
||||
onSuccess = {
|
||||
when (it) {
|
||||
is RegistrationResult.Success -> onSessionCreated(it.session, isAccountCreated = true)
|
||||
is RegistrationResult.FlowResponse -> onFlowResponse(it.flowResult)
|
||||
when {
|
||||
action.ignoresResult() -> {
|
||||
// do nothing
|
||||
}
|
||||
else -> when (it) {
|
||||
is RegistrationResult.Success -> onSessionCreated(it.session, isAccountCreated = true)
|
||||
is RegistrationResult.FlowResponse -> onFlowResponse(it.flowResult)
|
||||
}
|
||||
}
|
||||
},
|
||||
onFailure = {
|
||||
|
|
|
@ -55,6 +55,12 @@ sealed interface RegisterAction {
|
|||
object RegisterDummy : RegisterAction
|
||||
}
|
||||
|
||||
fun RegisterAction.ignoresResult() = when (this) {
|
||||
is RegisterAction.AddThreePid -> true
|
||||
is RegisterAction.SendAgainThreePid -> true
|
||||
else -> false
|
||||
}
|
||||
|
||||
fun RegisterAction.hasLoadingState() = when (this) {
|
||||
is RegisterAction.CheckIfEmailHasBeenValidated -> false
|
||||
else -> true
|
||||
|
|
Loading…
Reference in New Issue