From c9714a5e3f469314e7f6ff5dd161bbc2ea90153b Mon Sep 17 00:00:00 2001 From: Oleg Date: Wed, 13 Mar 2024 21:26:30 +0700 Subject: [PATCH] MOB-1856 - Fixed token logos inconsistency and added tokens sorting on public profile (#439) --- .../Entities/BalanceTokenUIDescription.swift | 3 ++- .../Public profile view/PublicProfileViewModel.swift | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/unstoppable-ios-app/domains-manager-ios/Entities/BalanceTokenUIDescription.swift b/unstoppable-ios-app/domains-manager-ios/Entities/BalanceTokenUIDescription.swift index 018524169..99bc9a21d 100644 --- a/unstoppable-ios-app/domains-manager-ios/Entities/BalanceTokenUIDescription.swift +++ b/unstoppable-ios-app/domains-manager-ios/Entities/BalanceTokenUIDescription.swift @@ -108,7 +108,8 @@ struct BalanceTokenUIDescription: Hashable, Identifiable { if let cachedImage = appContext.imageLoadingService.cachedImage(for: .currencyTicker(ticker, size: size, style: style), - downsampleDescription: .icon) { + downsampleDescription: .icon), + logoURL == nil { iconUpdated(cachedImage) return } diff --git a/unstoppable-ios-app/domains-manager-ios/Modules/DomainProfile/Public Profile/Public profile view/PublicProfileViewModel.swift b/unstoppable-ios-app/domains-manager-ios/Modules/DomainProfile/Public Profile/Public profile view/PublicProfileViewModel.swift index 94cbc012d..811f1e219 100644 --- a/unstoppable-ios-app/domains-manager-ios/Modules/DomainProfile/Public Profile/Public profile view/PublicProfileViewModel.swift +++ b/unstoppable-ios-app/domains-manager-ios/Modules/DomainProfile/Public Profile/Public profile view/PublicProfileViewModel.swift @@ -173,7 +173,7 @@ extension PublicProfileView { Task { await performAsyncErrorCatchingBlock { let balances = try await appContext.walletsDataService.loadBalanceFor(walletAddress: domain.walletAddress) - tokens = balances.map { BalanceTokenUIDescription.extractFrom(walletBalance: $0) }.flatMap({ $0 }) + tokens = balances.map { BalanceTokenUIDescription.extractFrom(walletBalance: $0) }.flatMap({ $0 }).sorted(by: { $0.balanceUsd > $1.balanceUsd }) } } }