Updated on 2026-08-14

This commit is contained in:
Tangem 2026-03-27 18:10:09 +05:00
parent 70617df9ad
commit dfbec1dee4
5 changed files with 34 additions and 30 deletions

View file

@ -34,10 +34,10 @@ internal object SwapAmountQuoteUtils {
secondaryFiatRateUSD: BigDecimal?,
primaryCryptoCurrencyStatus: CryptoCurrencyStatus,
secondaryCryptoCurrencyStatus: CryptoCurrencyStatus?,
): PriceImpact {
if (quoteContent == null) return PriceImpact.Empty
): PriceImpact? {
if (quoteContent == null) return null
val fromAmount = quoteContent.fromAmount ?: return PriceImpact.Empty
val fromAmount = quoteContent.fromAmount ?: return null
val toAmount = quoteContent.toAmount
val (fromRate, toRate) = if (swapDirection == SwapDirection.Direct) {

View file

@ -86,7 +86,7 @@ internal fun SwapAmountBlockContent(
val quoteContent = amountUM.selectedQuote as? SwapQuoteUM.Content
val isBestRate = quoteContent?.diffPercent is SwapQuoteUM.Content.DifferencePercent.Best
SwapChooseProviderContent(
isBestRate = isBestRate && amountUM.priceImpact?.shouldShowWarning() == true,
isBestRate = isBestRate && amountUM.priceImpact?.shouldShowWarning() != true,
isSingleProvider = quoteContent?.isSingleProvider == true,
showBestRateAnimation = amountUM.isShowBestRateAnimation,
expressProvider = amountUM.selectedQuote.provider,