Updated on 2026-08-14

This commit is contained in:
Tangem 2025-12-16 15:12:42 +03:00
parent 0ccfceba04
commit 35e0cccc90
12 changed files with 110 additions and 5 deletions

View file

@ -111,6 +111,7 @@ internal class AllOffersStateFactory(
-> true
is OnrampError.AmountError,
is OnrampError.RedirectError,
is OnrampError.AlreadyHandledTransaction,
-> false
}
}

View file

@ -63,6 +63,7 @@ internal class OnrampStateFactory(
is OnrampError.AmountError.TooSmallError,
OnrampError.RedirectError.VerificationFailed,
OnrampError.RedirectError.WrongRequestId,
OnrampError.AlreadyHandledTransaction,
-> currentStateProvider() // ignore error state
}
}

View file

@ -86,6 +86,7 @@ internal class OnrampV2StateFactory(
is OnrampError.AmountError.TooSmallError,
OnrampError.RedirectError.VerificationFailed,
OnrampError.RedirectError.WrongRequestId,
OnrampError.AlreadyHandledTransaction,
-> currentStateProvider() // ignore error state
}
}

View file

@ -177,10 +177,12 @@ internal class OnrampSuccessComponentModel @Inject constructor(
private fun showErrorAlert(error: OnrampError) {
val errorCode = (error as? OnrampError.DataError)?.code
val message = DialogMessage(
message = if (errorCode.isNullOrBlank()) {
resourceReference(R.string.common_unknown_error)
} else {
resourceReference(R.string.express_error_code, wrappedList(errorCode))
message = when {
!errorCode.isNullOrBlank() -> resourceReference(R.string.express_error_code, wrappedList(errorCode))
error is OnrampError.AlreadyHandledTransaction -> resourceReference(
R.string.onramp_error_transaction_already_processed,
)
else -> resourceReference(R.string.common_unknown_error)
},
firstActionBuilder = {
okAction(router::pop)

View file

@ -31,5 +31,6 @@ internal fun AnalyticsEventHandler.sendOnrampErrorEvent(
OnrampError.RedirectError.VerificationFailed,
OnrampError.RedirectError.WrongRequestId,
OnrampError.PairsNotFound,
OnrampError.AlreadyHandledTransaction,
-> { /* no-op */ }
}