From 2b7095a850573e92e9f8bd9ebcf7f13d25d49b99 Mon Sep 17 00:00:00 2001 From: Tangem Date: Fri, 7 Jun 2024 11:41:01 +0800 Subject: [PATCH] Updated on 2026-08-14 --- .../java/com/tangem/feature/swap/ui/StateBuilder.kt | 13 ++++++++++--- gradle/dependencies.toml | 2 +- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/features/swap/presentation/src/main/java/com/tangem/feature/swap/ui/StateBuilder.kt b/features/swap/presentation/src/main/java/com/tangem/feature/swap/ui/StateBuilder.kt index 17e7bfb369..1d6b6a1bb3 100644 --- a/features/swap/presentation/src/main/java/com/tangem/feature/swap/ui/StateBuilder.kt +++ b/features/swap/presentation/src/main/java/com/tangem/feature/swap/ui/StateBuilder.kt @@ -543,8 +543,15 @@ internal class StateBuilder( val preparedSwapConfigState = quoteModel.preparedSwapConfigState // check has has outgoing transaction if (preparedSwapConfigState.hasOutgoingTransaction) return false + // check has MinAmountWarning warning - if (quoteModel.warnings.filterIsInstance().isNotEmpty()) return false + val hasCriticalWarning = quoteModel.warnings.any { + it is Warning.MinAmountWarning || it is Warning.Cardano.InsufficientBalanceToTransferCoin || + it is Warning.Cardano.InsufficientBalanceToTransferToken + } + + if (hasCriticalWarning) return false + return when (preparedSwapConfigState.includeFeeInAmount) { IncludeFeeInAmount.BalanceNotEnough -> false IncludeFeeInAmount.Excluded -> @@ -1460,7 +1467,7 @@ internal class StateBuilder( NotificationConfig( title = resourceReference(id = R.string.cardano_max_amount_has_token_title), subtitle = resourceReference(id = R.string.cardano_max_amount_has_token_description), - iconResId = R.drawable.img_attention_20, + iconResId = R.drawable.ic_alert_circle_24, ), ) } @@ -1473,7 +1480,7 @@ internal class StateBuilder( id = R.string.cardano_insufficient_balance_to_send_token_description, formatArgs = wrappedList(tokenName), ), - iconResId = R.drawable.img_attention_20, + iconResId = R.drawable.ic_alert_circle_24, ), ) } diff --git a/gradle/dependencies.toml b/gradle/dependencies.toml index 1c39d3dab3..4c77d4b171 100644 --- a/gradle/dependencies.toml +++ b/gradle/dependencies.toml @@ -87,7 +87,7 @@ markdown = "0.7.2" # endregion Other libraries # region Tangem -tangemBlockchainSdk = "release-app_5.12-660" +tangemBlockchainSdk = "release-app_5.12-664" #tangemBlockchainSdk = "0.0.1" # Keep it! - used for local builds tangemCardSdk = "release-app_5.12-364" #tangemCardSdk = "0.0.1" # Keep it! - used for local builds ^