Skip to content

Commit

Permalink
Set featured quote for MultiSwap module
Browse files Browse the repository at this point in the history
  • Loading branch information
ealymbaev committed Sep 6, 2024
1 parent ff8488a commit baeec1c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
4 changes: 2 additions & 2 deletions UnstoppableWallet/UnstoppableWallet.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit baeec1c

Please sign in to comment.