adding dedicated fail event in the legacy onboarding flow when the reset password new password is not set
This commit is contained in:
parent
32389a9b33
commit
fa5b7c66ca
@ -531,9 +531,17 @@ class LoginViewModel @AssistedInject constructor(
|
|||||||
}
|
}
|
||||||
|
|
||||||
currentJob = viewModelScope.launch {
|
currentJob = viewModelScope.launch {
|
||||||
try {
|
|
||||||
val state = awaitState()
|
val state = awaitState()
|
||||||
safeLoginWizard.resetPasswordMailConfirmed(state.resetPasswordNewPassword!!)
|
|
||||||
|
if (state.resetPasswordNewPassword == null)
|
||||||
|
setState {
|
||||||
|
copy(
|
||||||
|
asyncResetPassword = Uninitialized,
|
||||||
|
asyncResetMailConfirmed = Fail(Throwable("Developer error - New password not set"))
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
try {
|
||||||
|
safeLoginWizard.resetPasswordMailConfirmed(state.resetPasswordNewPassword)
|
||||||
} catch (failure: Throwable) {
|
} catch (failure: Throwable) {
|
||||||
setState {
|
setState {
|
||||||
copy(
|
copy(
|
||||||
@ -549,11 +557,11 @@ class LoginViewModel @AssistedInject constructor(
|
|||||||
resetPasswordNewPassword = null
|
resetPasswordNewPassword = null
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
_viewEvents.post(LoginViewEvents.OnResetPasswordMailConfirmationSuccess)
|
_viewEvents.post(LoginViewEvents.OnResetPasswordMailConfirmationSuccess)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private fun handleLoginOrRegister(action: LoginAction.LoginOrRegister) = withState { state ->
|
private fun handleLoginOrRegister(action: LoginAction.LoginOrRegister) = withState { state ->
|
||||||
when (state.signMode) {
|
when (state.signMode) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user