From 64255f2b371ec53713d444819c4732966f7193f5 Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Thu, 3 Feb 2022 15:26:49 +0000 Subject: [PATCH] Remove asset purgatory workaround (#1056) * revert asset purgatory workaround * reverts #1016 * asset loading fix --- src/@context/Asset.tsx | 19 +++++++++---------- src/@utils/aquarius.ts | 2 +- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/@context/Asset.tsx b/src/@context/Asset.tsx index d6e78a654..689d6ef22 100644 --- a/src/@context/Asset.tsx +++ b/src/@context/Asset.tsx @@ -77,18 +77,17 @@ function AssetProvider({ LoggerInstance.error(`[asset] Failed getting asset for ${did}`, asset) } else { setError(undefined) + setAsset((prevState) => ({ + ...prevState, + ...asset + })) + setTitle(asset.metadata?.name) + setOwner(asset.nft?.owner) + setIsInPurgatory(asset.purgatory?.state) + setPurgatoryData(asset.purgatory) + LoggerInstance.log('[asset] Got asset', asset) } - setAsset((prevState) => ({ - ...prevState, - ...asset - })) - setTitle(asset.metadata.name) - setOwner(asset.nft.owner) - setIsInPurgatory((asset.purgatory?.state as unknown as string) === 'true') - setPurgatoryData(asset.purgatory) - LoggerInstance.log('[asset] Got asset', asset) - setLoading(false) }, [did] diff --git a/src/@utils/aquarius.ts b/src/@utils/aquarius.ts index a7fea4977..4c8d0866c 100644 --- a/src/@utils/aquarius.ts +++ b/src/@utils/aquarius.ts @@ -48,7 +48,7 @@ export function generateBaseQuery( getFilterTerm('_index', 'aquarius'), ...(baseQueryParams.ignorePurgatory ? [] - : [getFilterTerm('purgatory.state', 'false')]) + : [getFilterTerm('purgatory.state', false)]) ] } }