From 6d9c467b20241d797374d7e57d0f15e8ec80c083 Mon Sep 17 00:00:00 2001 From: Tangem Date: Wed, 25 Oct 2023 12:39:10 +0400 Subject: [PATCH] Updated on 2026-08-14 --- .../tangem/tap/common/feedback/AdditionalFeedbackInfo.kt | 8 ++++++-- .../send/redux/middlewares/RequestFeeMiddleware.kt | 8 ++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/tangem/tap/common/feedback/AdditionalFeedbackInfo.kt b/app/src/main/java/com/tangem/tap/common/feedback/AdditionalFeedbackInfo.kt index 157b46fe76..b28a3256cb 100644 --- a/app/src/main/java/com/tangem/tap/common/feedback/AdditionalFeedbackInfo.kt +++ b/app/src/main/java/com/tangem/tap/common/feedback/AdditionalFeedbackInfo.kt @@ -80,13 +80,17 @@ class AdditionalFeedbackInfo { fun updateOnSendError( walletManager: WalletManager, amountToSend: Amount, - feeAmount: Amount, + feeAmount: Amount?, destinationAddress: String, ) { onSendErrorWalletInfo = createEmailWalletInfo(walletManager) this.destinationAddress = destinationAddress amount = amountToSend.value?.stripZeroPlainString() ?: "0" - fee = feeAmount.value?.stripZeroPlainString() ?: "0" + fee = if (feeAmount != null) { + feeAmount.value?.stripZeroPlainString() ?: "0" + } else { + "Unable to receive" + } token = if (amountToSend.type is AmountType.Token) amountToSend.currencySymbol else "" } diff --git a/app/src/main/java/com/tangem/tap/features/send/redux/middlewares/RequestFeeMiddleware.kt b/app/src/main/java/com/tangem/tap/features/send/redux/middlewares/RequestFeeMiddleware.kt index efdd59f799..2cb96aa486 100644 --- a/app/src/main/java/com/tangem/tap/features/send/redux/middlewares/RequestFeeMiddleware.kt +++ b/app/src/main/java/com/tangem/tap/features/send/redux/middlewares/RequestFeeMiddleware.kt @@ -15,6 +15,7 @@ import com.tangem.tap.features.send.redux.ReceiptAction import com.tangem.tap.features.send.redux.SendAction import com.tangem.tap.features.send.redux.states.SendState import com.tangem.tap.scope +import com.tangem.tap.store import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch import kotlinx.coroutines.withContext @@ -72,6 +73,13 @@ class RequestFeeMiddleware { dispatch(FeeAction.FeeCalculation.ClearResult) dispatch(FeeAction.ChangeLayoutVisibility(main = false)) + store.state.globalState.feedbackManager?.infoHolder?.updateOnSendError( + walletManager = walletManager, + amountToSend = destinationAmount, + feeAmount = null, + destinationAddress = destinationAddress, + ) + val blockchainSdkError = feeResult.error as? BlockchainSdkError ?: return@withContext dispatch( SendAction.Dialog.RequestFeeError(