diff --git a/features/swap/impl/src/main/java/com/tangem/feature/swap/model/SwapNotificationsFactory.kt b/features/swap/impl/src/main/java/com/tangem/feature/swap/model/SwapNotificationsFactory.kt index 7f9c144c0f..99ecd52206 100644 --- a/features/swap/impl/src/main/java/com/tangem/feature/swap/model/SwapNotificationsFactory.kt +++ b/features/swap/impl/src/main/java/com/tangem/feature/swap/model/SwapNotificationsFactory.kt @@ -36,6 +36,7 @@ import com.tangem.lib.crypto.BlockchainUtils import com.tangem.lib.crypto.BlockchainUtils.getTezosThreshold import com.tangem.lib.crypto.BlockchainUtils.isTezos import com.tangem.utils.Provider +import com.tangem.utils.extensions.isZero import com.tangem.utils.extensions.orZero import kotlinx.collections.immutable.ImmutableList import kotlinx.collections.immutable.persistentListOf @@ -215,7 +216,7 @@ internal class SwapNotificationsFactory( actions.onReduceToAmount(amount.copy(value = reduceTo)) }, ) - if (!isCardano) { + if (!isCardano && !feeValue.isZero()) { addDustWarningNotification( dustValue = quoteModel.currencyCheck?.dustValue, feeValue = feeValue, diff --git a/features/swap/impl/src/main/java/com/tangem/feature/swap/ui/transfer/SwapTransferNotificationsFactory.kt b/features/swap/impl/src/main/java/com/tangem/feature/swap/ui/transfer/SwapTransferNotificationsFactory.kt index e863c9ef7b..778e8eff18 100644 --- a/features/swap/impl/src/main/java/com/tangem/feature/swap/ui/transfer/SwapTransferNotificationsFactory.kt +++ b/features/swap/impl/src/main/java/com/tangem/feature/swap/ui/transfer/SwapTransferNotificationsFactory.kt @@ -24,6 +24,7 @@ import com.tangem.lib.crypto.BlockchainUtils import com.tangem.lib.crypto.BlockchainUtils.getTezosThreshold import com.tangem.lib.crypto.BlockchainUtils.isTezos import com.tangem.lib.crypto.BlockchainUtils.isTron +import com.tangem.utils.extensions.isZero import com.tangem.utils.extensions.orZero import kotlinx.collections.immutable.ImmutableList import kotlinx.collections.immutable.toPersistentList @@ -112,7 +113,7 @@ internal class SwapTransferNotificationsFactory @Inject constructor() { onReduceToAmount(amount.copy(value = reduceTo)) }, ) - if (!isCardano) { + if (!isCardano && !feeValue.isZero()) { addDustWarningNotification( dustValue = state.currencyCheck?.dustValue, feeValue = feeValue, diff --git a/features/swap/impl/src/test/java/com/tangem/feature/swap/ui/transfer/SwapTransferNotificationsFactoryTest.kt b/features/swap/impl/src/test/java/com/tangem/feature/swap/ui/transfer/SwapTransferNotificationsFactoryTest.kt index 0c7767d828..61eb7d7ac8 100644 --- a/features/swap/impl/src/test/java/com/tangem/feature/swap/ui/transfer/SwapTransferNotificationsFactoryTest.kt +++ b/features/swap/impl/src/test/java/com/tangem/feature/swap/ui/transfer/SwapTransferNotificationsFactoryTest.kt @@ -113,7 +113,9 @@ internal class SwapTransferNotificationsFactoryTest { val result = sut.getNotifications( transferState = transferState, - feeSelectorUM = null, + // A loaded (non-zero) fee is required: the manual dust check is now skipped when feeValue is zero + // (fee errored / not yet loaded), so it cannot duplicate the fee-error path's MinimumAmountError. + feeSelectorUM = contentWithFee(feeValue = BigDecimal("0.001")), feeCryptoCurrencyStatus = null, actions = actions, )