diff --git a/apps/dashboard/src/pages/search-pages/nft/Nft.svelte b/apps/dashboard/src/pages/search-pages/nft/Nft.svelte index f0ba99049..a58a01497 100644 --- a/apps/dashboard/src/pages/search-pages/nft/Nft.svelte +++ b/apps/dashboard/src/pages/search-pages/nft/Nft.svelte @@ -5,6 +5,7 @@ import NftDataRow from './NftDataRow.svelte' import type { NonFungible } from '@api/utils/nfts' import type { NonFungibleResource } from '@api/utils/entities/resource/non-fungible' + import { networkConfiguration } from '@stores' export let nft: Promise export let resource: Promise @@ -28,57 +29,78 @@ : resource.metadata.expected.description?.typed.value ) + let hasNoNft: boolean + $: Promise.all([nft, resource]).then(([nft, resource]) => { + const resourceAddresses = $networkConfiguration?.well_known_addresses + if ( + ![ + resourceAddresses?.ed25519_signature_virtual_badge, + resourceAddresses?.package_of_direct_caller_virtual_badge, + resourceAddresses?.secp256k1_signature_virtual_badge, + resourceAddresses?.global_caller_virtual_badge + ].includes(resource.address) + ) { + hasNoNft = !nft + } + }) + const imageSize = 'large' -
- {#await imageUrl} - - {:then url} - - {/await} -
+{#if hasNoNft} +
+

There is no non-fungible with this local ID

+
+{:else} +
+ {#await imageUrl} + + {:then url} + + {/await} +
-
-

- {#await nft} - - {:then nft} - {#if nft} - {@const { - nftData: { - expected: { name } - } - } = nft} - {#if name?.value} - {name?.value} +
+

+ {#await nft} + + {:then nft} + {#if nft} + {@const { + nftData: { + expected: { name } + } + } = nft} + {#if name?.value} + {name?.value} + {/if} {/if} - {/if} - {/await} -

+ {/await} +

- {#await description} - - {:then description} - {#if description} - {description} - {/if} - {/await} -
- {#await nft} - - {:then nft} - {#if nft} - - {#each nft.type === 'generalNft' ? nft.nftData.nonStandard : Object.values(nft.nftData.expected).filter((data) => data.field_name !== 'name') as value} - - {/each} + {#await description} + + {:then description} + {#if description} + {description} {/if} {/await} +
+ {#await nft} + + {:then nft} + {#if nft} + + {#each nft.type === 'generalNft' ? nft.nftData.nonStandard : Object.values(nft.nftData.expected).filter((data) => data.field_name !== 'name') as value} + + {/each} + {/if} + {/await} +
-
+{/if}

Belongs To:

@@ -90,6 +112,14 @@ />