From baeec1cc0ff47fa3cb547d4f3087d20f6993f386 Mon Sep 17 00:00:00 2001 From: EA Date: Fri, 6 Sep 2024 11:51:33 +0600 Subject: [PATCH] Set featured quote for MultiSwap module --- .../UnstoppableWallet.xcodeproj/project.pbxproj | 4 ++-- .../Modules/MultiSwap/MultiSwapQuotesView.swift | 6 +++--- .../Modules/MultiSwap/MultiSwapViewModel.swift | 7 ++++++- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/UnstoppableWallet/UnstoppableWallet.xcodeproj/project.pbxproj b/UnstoppableWallet/UnstoppableWallet.xcodeproj/project.pbxproj index 07e86144b4..8794e7c7bb 100644 --- a/UnstoppableWallet/UnstoppableWallet.xcodeproj/project.pbxproj +++ b/UnstoppableWallet/UnstoppableWallet.xcodeproj/project.pbxproj @@ -12608,7 +12608,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 0.39.2; + MARKETING_VERSION = 0.39.3; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; OfficeMode = true; @@ -12680,7 +12680,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 0.39.2; + MARKETING_VERSION = 0.39.3; MTL_ENABLE_DEBUG_INFO = NO; OfficeMode = false; SDKROOT = iphoneos; diff --git a/UnstoppableWallet/UnstoppableWallet/Modules/MultiSwap/MultiSwapQuotesView.swift b/UnstoppableWallet/UnstoppableWallet/Modules/MultiSwap/MultiSwapQuotesView.swift index e09cfd0c55..333410df55 100644 --- a/UnstoppableWallet/UnstoppableWallet/Modules/MultiSwap/MultiSwapQuotesView.swift +++ b/UnstoppableWallet/UnstoppableWallet/Modules/MultiSwap/MultiSwapQuotesView.swift @@ -22,9 +22,9 @@ struct MultiSwapQuotesView: View { VStack(alignment: .leading, spacing: 1) { Text(quote.provider.name).textSubhead2(color: .themeLeah) - if quote.provider.id == viewModel.bestQuote?.provider.id { - Text("swap.quotes.best_price".localized).textSubhead2(color: .themeRemus) - } + // if quote.provider.id == viewModel.bestQuote?.provider.id { + // Text("swap.quotes.best_price".localized).textSubhead2(color: .themeRemus) + // } } Spacer() diff --git a/UnstoppableWallet/UnstoppableWallet/Modules/MultiSwap/MultiSwapViewModel.swift b/UnstoppableWallet/UnstoppableWallet/Modules/MultiSwap/MultiSwapViewModel.swift index 064c2395a8..d264d95749 100644 --- a/UnstoppableWallet/UnstoppableWallet/Modules/MultiSwap/MultiSwapViewModel.swift +++ b/UnstoppableWallet/UnstoppableWallet/Modules/MultiSwap/MultiSwapViewModel.swift @@ -253,7 +253,12 @@ class MultiSwapViewModel: ObservableObject { @Published var quotes: [Quote] = [] { didSet { - bestQuote = quotes.max { $0.quote.amountOut < $1.quote.amountOut } + if let featuredQuote = quotes.first(where: { $0.provider is OneInchMultiSwapProvider }) { + bestQuote = featuredQuote + } else { + bestQuote = quotes.max { $0.quote.amountOut < $1.quote.amountOut } + } + syncCurrentQuote() timer?.invalidate()