From d51538a32f0498641d9166e39be2526c7efa1645 Mon Sep 17 00:00:00 2001 From: Jamie Hewitt Date: Thu, 17 Nov 2022 13:39:49 +0300 Subject: [PATCH] Only showing payment collector if it is different to the owner --- src/components/Asset/AssetContent/MetaFull.tsx | 2 +- src/components/Asset/Edit/EditMetadata.tsx | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/components/Asset/AssetContent/MetaFull.tsx b/src/components/Asset/AssetContent/MetaFull.tsx index f662fa374..f01d71915 100644 --- a/src/components/Asset/AssetContent/MetaFull.tsx +++ b/src/components/Asset/AssetContent/MetaFull.tsx @@ -40,7 +40,7 @@ export default function MetaFull({ ddo }: { ddo: Asset }): ReactElement { title="Owner" content={} /> - {paymentCollector !== ddo?.nft?.owner && ( + {paymentCollector && paymentCollector !== ddo?.nft?.owner && ( } diff --git a/src/components/Asset/Edit/EditMetadata.tsx b/src/components/Asset/Edit/EditMetadata.tsx index ef727b591..6ba94e35f 100644 --- a/src/components/Asset/Edit/EditMetadata.tsx +++ b/src/components/Asset/Edit/EditMetadata.tsx @@ -44,11 +44,10 @@ export default function Edit({ useEffect(() => { async function getInitialPaymentCollector() { - let paymentCollector try { const datatoken = new Datatoken(web3) setPaymentCollector( - await datatoken.getPaymentCollector(ddo.datatokens[0].address) + await datatoken.getPaymentCollector(asset?.datatokens[0].address) ) } catch (error) { LoggerInstance.error(