replacing comment extracted function (also convered by a test case)
This commit is contained in:
parent
ba18c6f3e2
commit
ef1356f4dd
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user