Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix(wallet): fallback to token.logo as the NFT image url #27129

Merged
merged 1 commit into from
Jan 6, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading