Skip to content

Commit

Permalink
fix(wallet): fallback to token.logo as the NFT image url (#27129)
Browse files Browse the repository at this point in the history
  • Loading branch information
nuo-xu authored Jan 6, 2025
1 parent 15ddcbb commit 1b43119
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion ios/brave-ios/Sources/BraveWallet/Crypto/NFT/NFTView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

import BraveCore
import BraveUI
import DesignSystem
import Preferences
import SwiftUI
Expand Down Expand Up @@ -70,7 +71,19 @@ struct NFTView: View {
Group {
if let urlString = nftViewModel.nftMetadata?.image {
NFTImageView(urlString: urlString) {
LoadingNFTView(shimmer: false)
if let url = URL(string: nftViewModel.token.logo) {
WebImageReader(url: url) { image in
if let image = image {
Image(uiImage: image)
.resizable()
.aspectRatio(contentMode: .fit)
} else {
LoadingNFTView(shimmer: false)
}
}
} else {
LoadingNFTView(shimmer: false)
}
}
} else {
LoadingNFTView(shimmer: false)
Expand Down

0 comments on commit 1b43119

Please # to comment.