Updated on 2026-08-14

This commit is contained in:
Tangem 2024-04-27 21:34:59 +05:00
parent 390513dc53
commit 54cc9e6245
2 changed files with 4 additions and 3 deletions

View file

@ -71,7 +71,7 @@ internal class SendNotificationFactory(
buildList {
// errors
addFeeUnreachableNotification(feeState.feeSelectorState)
addExceedBalanceNotification(feeValue, sendingAmount)
addExceedBalanceNotification(feeValue, sendingAmount, isFeeCoverage)
addExceedsBalanceNotification(feeState.fee)
addDustWarningNotification(feeValue, sendingAmount)
addTransactionLimitErrorNotification(feeValue, sendingAmount)
@ -107,11 +107,12 @@ internal class SendNotificationFactory(
private fun MutableList<SendNotification>.addExceedBalanceNotification(
feeAmount: BigDecimal,
receivedAmount: BigDecimal,
isFeeCoverage: Boolean,
) {
val cryptoCurrencyStatus = cryptoCurrencyStatusProvider()
val balance = cryptoCurrencyStatus.value.amount ?: BigDecimal.ZERO
if (!isSubtractAvailableProvider()) return
if (isFeeCoverage) return
val showNotification = receivedAmount + feeAmount > balance
if (showNotification) {

View file

@ -45,7 +45,7 @@ internal fun checkFeeCoverage(
feeValue: BigDecimal,
): Boolean {
if (!isSubtractAvailable) return false
return balance < amountValue + feeValue && balance > feeValue
return balance < amountValue + feeValue && balance > feeValue && balance >= amountValue
}
/**