From 19646fdb0394d95c4e4368281e55746135fbfd14 Mon Sep 17 00:00:00 2001 From: Tangem Date: Tue, 18 Oct 2022 00:00:45 +0500 Subject: [PATCH] Updated on 2026-08-14 --- .../SaltPayRegistrationErrorConverter.kt | 15 +++++++++++---- .../saltPay/message/SaltPayModuleMessage.kt | 6 +++++- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/com/tangem/tap/domain/moduleMessage/saltPay/converter/SaltPayRegistrationErrorConverter.kt b/app/src/main/java/com/tangem/tap/domain/moduleMessage/saltPay/converter/SaltPayRegistrationErrorConverter.kt index 10f704f117..554a0cab44 100644 --- a/app/src/main/java/com/tangem/tap/domain/moduleMessage/saltPay/converter/SaltPayRegistrationErrorConverter.kt +++ b/app/src/main/java/com/tangem/tap/domain/moduleMessage/saltPay/converter/SaltPayRegistrationErrorConverter.kt @@ -35,10 +35,17 @@ internal class SaltPayRegistrationErrorConverter( message = context.getString(R.string.saltpay_error_pin_weak_message), ) } - else -> ConvertedDialogMessage( - title = context.getString(R.string.common_error), - message = saltPayError.message, - ) + else -> { + val errorMessage = if (saltPayError.message == SaltPayRegistrationError.EMPTY_MESSAGE) { + saltPayError::class.java.simpleName + } else { + saltPayError.message + } + ConvertedDialogMessage( + title = context.getString(R.string.common_error), + message = errorMessage, + ) + } } return dialogMessage diff --git a/app/src/main/java/com/tangem/tap/features/onboarding/products/wallet/saltPay/message/SaltPayModuleMessage.kt b/app/src/main/java/com/tangem/tap/features/onboarding/products/wallet/saltPay/message/SaltPayModuleMessage.kt index f299b0ebda..144647b876 100644 --- a/app/src/main/java/com/tangem/tap/features/onboarding/products/wallet/saltPay/message/SaltPayModuleMessage.kt +++ b/app/src/main/java/com/tangem/tap/features/onboarding/products/wallet/saltPay/message/SaltPayModuleMessage.kt @@ -26,7 +26,7 @@ sealed class SaltPayRegistrationError( override val data: Any? = null, ) : SaltPayModuleError( subCode = ERROR_CODE_REGISTRATION + subCode, - message = message ?: this::class.java.simpleName, + message = message ?: EMPTY_MESSAGE, ) { object Unknown : SaltPayRegistrationError(4) object Empty : SaltPayRegistrationError(4) @@ -44,4 +44,8 @@ sealed class SaltPayRegistrationError( object EmptyDynamicAttestResponse : SaltPayRegistrationError(11) object EmptyBackupCardScanned : SaltPayRegistrationError(12) // object WeakPin : SaltPayRegistrationError(13) // + + companion object { + const val EMPTY_MESSAGE = "" + } } \ No newline at end of file