From daecd7d43a55c6c66dabf45840e59f00cfda25ab Mon Sep 17 00:00:00 2001 From: Adam Brown Date: Mon, 4 Jul 2022 09:21:15 +0100 Subject: [PATCH] returning the error result directly from the when --- .../ftueauth/FtueAuthPhoneConfirmationFragment.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthPhoneConfirmationFragment.kt b/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthPhoneConfirmationFragment.kt index 584c6d6aa6..39577efa19 100644 --- a/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthPhoneConfirmationFragment.kt +++ b/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthPhoneConfirmationFragment.kt @@ -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) } }