returning the error result directly from the when

This commit is contained in:
Adam Brown 2022-07-04 09:21:15 +01:00
parent 82feda476d
commit daecd7d43a
1 changed files with 3 additions and 3 deletions

View File

@ -67,10 +67,10 @@ class FtueAuthPhoneConfirmationFragment @Inject constructor() : AbstractFtueAuth
}
override fun onError(throwable: Throwable) {
when (throwable) {
views.phoneConfirmationInput.error = when (throwable) {
// The entered code is not correct
is Failure.SuccessError -> views.phoneConfirmationInput.error = getString(R.string.login_validation_code_is_not_correct)
else -> views.phoneConfirmationInput.error = errorFormatter.toHumanReadable(throwable)
is Failure.SuccessError -> getString(R.string.login_validation_code_is_not_correct)
else -> errorFormatter.toHumanReadable(throwable)
}
}