mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-02-17 12:30:07 +03:00
replacing comment extracted function (also convered by a test case)
This commit is contained in:
parent
ba18c6f3e2
commit
ef1356f4dd
1 changed files with 4 additions and 2 deletions
|
@ -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…
Add table
Reference in a new issue