Updated on 2026-08-14

This commit is contained in:
Tangem 2024-06-06 17:53:12 +05:00
parent 0f6476b1ca
commit 94b59fcbe3
4 changed files with 24 additions and 21 deletions

View file

@ -541,17 +541,21 @@ internal class SendViewModel @Inject constructor(
}
override fun onFailedTxEmailClick(errorMessage: String) {
val recipient = uiState.recipientState?.addressTextField?.value ?: return
val feeValue = uiState.feeState?.fee?.amount?.value ?: return
val amountValue = uiState.amountState?.amountTextField?.cryptoAmount?.value ?: return
val recipient = uiState.recipientState?.addressTextField?.value
val feeValue = uiState.feeState?.fee?.amount?.value
val amountValue = uiState.amountState?.amountTextField?.cryptoAmount?.value
val receivingAmount = checkAndCalculateSubtractedAmount(
isAmountSubtractAvailable = isAmountSubtractAvailable,
cryptoCurrencyStatus = cryptoCurrencyStatus,
amountValue = amountValue,
feeValue = feeValue,
reduceAmountBy = uiState.sendState?.reduceAmountBy ?: BigDecimal.ZERO,
)
val receivingAmount = if (amountValue != null && feeValue != null) {
checkAndCalculateSubtractedAmount(
isAmountSubtractAvailable = isAmountSubtractAvailable,
cryptoCurrencyStatus = cryptoCurrencyStatus,
amountValue = amountValue,
feeValue = feeValue,
reduceAmountBy = uiState.sendState?.reduceAmountBy ?: BigDecimal.ZERO,
)
} else {
null
}
reduxStateHolder.dispatch(
LegacyAction.SendEmailTransactionFailed(
cryptoCurrency = cryptoCurrency,