Merge pull request #4256 from AlphaWallet/fix-invalid-image-check-against-func-pointer-for-nft

Fix: invalid check for image URL because it was checking against a func pointer, which is always non-nil
pull/4257/head
Hwee-Boon Yar 3 years ago committed by GitHub
commit 4216460964
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      AlphaWallet/Tokens/ViewModels/OpenSeaNonFungibleTokenCardRowViewModel.swift

@ -169,6 +169,10 @@ struct OpenSeaNonFungibleTokenCardRowViewModel {
return convertDescriptionToAttributedString(asHTML: true)
}
var hasImageUrl: Bool {
tokenHolder.values.imageUrlUrlValue != nil
}
//This is needed because conversion from HTML to NSAttributedString is problematic if we do it while we are animating UI (force touch + peek as of writing this
var descriptionWithoutConvertingHtml: NSAttributedString {
return convertDescriptionToAttributedString(asHTML: false)
@ -205,7 +209,7 @@ struct OpenSeaNonFungibleTokenCardRowViewModel {
}
var areImagesHidden: Bool {
return tokenHolder.status == .availableButDataUnavailable || imageUrl == nil
return tokenHolder.status == .availableButDataUnavailable || hasImageUrl
}
var isDescriptionHidden: Bool {

Loading…
Cancel
Save