diff --git a/vector/src/main/java/im/vector/app/features/onboarding/RegistrationActionHandler.kt b/vector/src/main/java/im/vector/app/features/onboarding/RegistrationActionHandler.kt index 9520413cd8..b9569dc15f 100644 --- a/vector/src/main/java/im/vector/app/features/onboarding/RegistrationActionHandler.kt +++ b/vector/src/main/java/im/vector/app/features/onboarding/RegistrationActionHandler.kt @@ -54,14 +54,16 @@ class RegistrationActionHandler @Inject constructor( } private suspend fun processFlowResult(result: RegistrationResult.NextStep, state: SelectedHomeserverState): Result { - // If dummy stage is mandatory, and password is already sent, do the dummy stage now - return if (authenticationService.isRegistrationStarted() && result.flowResult.missingStages.hasMandatoryDummy()) { + return if (shouldFastTrackDummyAction(result)) { processAction(state, RegisterAction.RegisterDummy) } else { handleNextStep(state, result.flowResult) } } + private fun shouldFastTrackDummyAction(result: RegistrationResult.NextStep) = authenticationService.isRegistrationStarted() && + result.flowResult.missingStages.hasMandatoryDummy() + private suspend fun handleNextStep(state: SelectedHomeserverState, flowResult: FlowResult): Result { return when { flowResult.registrationShouldFallback() -> Result.UnsupportedStage