Updated on 2026-08-14

This commit is contained in:
Tangem 2023-10-25 12:39:10 +04:00
parent 1be3c98dbd
commit 6d9c467b20
2 changed files with 14 additions and 2 deletions

View file

@ -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 ""
}

View file

@ -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(