mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-26 03:16:02 +03:00
avoiding cancelling the polling job when resending verification email
This commit is contained in:
parent
bc5ebb20b5
commit
47635aae6e
1 changed files with 10 additions and 1 deletions
|
@ -256,13 +256,22 @@ class OnboardingViewModel @AssistedInject constructor(
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun handleRegisterAction(action: RegisterAction, onNextRegistrationStepAction: (FlowResult) -> Unit) {
|
private fun handleRegisterAction(action: RegisterAction, onNextRegistrationStepAction: (FlowResult) -> Unit) {
|
||||||
currentJob = viewModelScope.launch {
|
val job = viewModelScope.launch {
|
||||||
if (action.hasLoadingState()) {
|
if (action.hasLoadingState()) {
|
||||||
setState { copy(isLoading = true) }
|
setState { copy(isLoading = true) }
|
||||||
}
|
}
|
||||||
internalRegisterAction(action, onNextRegistrationStepAction)
|
internalRegisterAction(action, onNextRegistrationStepAction)
|
||||||
setState { copy(isLoading = false) }
|
setState { copy(isLoading = false) }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
when (action) {
|
||||||
|
is RegisterAction.SendAgainThreePid -> {
|
||||||
|
// avoid cancelling the current job which is polling for verification complete
|
||||||
|
}
|
||||||
|
else -> {
|
||||||
|
currentJob = job
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private suspend fun internalRegisterAction(action: RegisterAction, onNextRegistrationStepAction: (FlowResult) -> Unit) {
|
private suspend fun internalRegisterAction(action: RegisterAction, onNextRegistrationStepAction: (FlowResult) -> Unit) {
|
||||||
|
|
Loading…
Reference in a new issue