From 861a71b0bc6155046dd0ef2984bfe1d5ad0efb4f Mon Sep 17 00:00:00 2001 From: Hwee-Boon Yar Date: Thu, 7 Apr 2022 12:48:07 +0800 Subject: [PATCH] Fix: invalid check for image URL because it was checking against a func pointer, which is always non-nil --- .../OpenSeaNonFungibleTokenCardRowViewModel.swift | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/AlphaWallet/Tokens/ViewModels/OpenSeaNonFungibleTokenCardRowViewModel.swift b/AlphaWallet/Tokens/ViewModels/OpenSeaNonFungibleTokenCardRowViewModel.swift index 98683b07c..6deebdee0 100644 --- a/AlphaWallet/Tokens/ViewModels/OpenSeaNonFungibleTokenCardRowViewModel.swift +++ b/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 {