Updated on 2026-08-14

This commit is contained in:
Tangem 2024-06-06 17:07:45 +05:00
parent 89d2242502
commit 0f6476b1ca
3 changed files with 68 additions and 5 deletions

View file

@ -541,7 +541,27 @@ internal class SendViewModel @Inject constructor(
}
override fun onFailedTxEmailClick(errorMessage: String) {
reduxStateHolder.dispatch(LegacyAction.SendEmailTransactionFailed(errorMessage))
val recipient = uiState.recipientState?.addressTextField?.value ?: return
val feeValue = uiState.feeState?.fee?.amount?.value ?: return
val amountValue = uiState.amountState?.amountTextField?.cryptoAmount?.value ?: return
val receivingAmount = checkAndCalculateSubtractedAmount(
isAmountSubtractAvailable = isAmountSubtractAvailable,
cryptoCurrencyStatus = cryptoCurrencyStatus,
amountValue = amountValue,
feeValue = feeValue,
reduceAmountBy = uiState.sendState?.reduceAmountBy ?: BigDecimal.ZERO,
)
reduxStateHolder.dispatch(
LegacyAction.SendEmailTransactionFailed(
cryptoCurrency = cryptoCurrency,
userWalletId = userWalletId,
amount = receivingAmount,
fee = feeValue,
destinationAddress = recipient,
errorMessage = errorMessage,
),
)
}
override fun onTokenDetailsClick(userWalletId: UserWalletId, currency: CryptoCurrency) =