From 35b58e96c4a1c0648488aa995b07ed8f2f5cb9a7 Mon Sep 17 00:00:00 2001 From: Tangem Date: Tue, 30 Jan 2024 20:06:48 +0500 Subject: [PATCH] Updated on 2026-08-14 --- .../com/tangem/domain/tokens/GetCurrencyWarningsUseCase.kt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/domain/tokens/src/main/kotlin/com/tangem/domain/tokens/GetCurrencyWarningsUseCase.kt b/domain/tokens/src/main/kotlin/com/tangem/domain/tokens/GetCurrencyWarningsUseCase.kt index 9599d1a964..3545e10ba9 100644 --- a/domain/tokens/src/main/kotlin/com/tangem/domain/tokens/GetCurrencyWarningsUseCase.kt +++ b/domain/tokens/src/main/kotlin/com/tangem/domain/tokens/GetCurrencyWarningsUseCase.kt @@ -200,7 +200,8 @@ class GetCurrencyWarningsUseCase( } feePaidCurrency is FeePaidCurrency.Token -> { val feePaidTokenBalance = feePaidCurrency.balance - if (!tokenStatus.value.amount.isZero() && feePaidTokenBalance.isZero()) { + val amount = tokenStatus.value.amount ?: return null + if (!amount.isZero() && feePaidTokenBalance.isZero()) { constructTokenBalanceNotEnoughWarning( userWalletId = userWalletId, tokenStatus = tokenStatus, @@ -222,7 +223,9 @@ class GetCurrencyWarningsUseCase( val token = currenciesRepository .getMultiCurrencyWalletCurrenciesSync(userWalletId) .find { - it is CryptoCurrency.Token && it.contractAddress.equals(feePaidToken.contractAddress, ignoreCase = true) + it is CryptoCurrency.Token && + it.contractAddress.equals(feePaidToken.contractAddress, ignoreCase = true) && + it.network.derivationPath == tokenStatus.currency.network.derivationPath } return if (token != null) { CryptoCurrencyWarning.CustomTokenNotEnoughForFee(