From 5ab6b7dc66b62f88ecb275f26e82f5794df31cd4 Mon Sep 17 00:00:00 2001 From: Jamie Hewitt Date: Thu, 17 Nov 2022 13:36:58 +0300 Subject: [PATCH] Setting payment collector inline --- src/components/Asset/AssetContent/MetaFull.tsx | 6 ++---- src/components/Asset/Edit/EditMetadata.tsx | 5 ++--- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/components/Asset/AssetContent/MetaFull.tsx b/src/components/Asset/AssetContent/MetaFull.tsx index 038601ca6..f662fa374 100644 --- a/src/components/Asset/AssetContent/MetaFull.tsx +++ b/src/components/Asset/AssetContent/MetaFull.tsx @@ -13,13 +13,11 @@ export default function MetaFull({ ddo }: { ddo: Asset }): ReactElement { useEffect(() => { async function getInitialPaymentCollector() { - let paymentCollector try { const datatoken = new Datatoken(web3) - paymentCollector = await datatoken.getPaymentCollector( - ddo.datatokens[0].address + setPaymentCollector( + await datatoken.getPaymentCollector(ddo.datatokens[0].address) ) - setPaymentCollector(paymentCollector) } catch (error) { LoggerInstance.error('[MetaFull: getInitialPaymentCollector]', error) } diff --git a/src/components/Asset/Edit/EditMetadata.tsx b/src/components/Asset/Edit/EditMetadata.tsx index b1b05d5ef..ef727b591 100644 --- a/src/components/Asset/Edit/EditMetadata.tsx +++ b/src/components/Asset/Edit/EditMetadata.tsx @@ -47,10 +47,9 @@ export default function Edit({ let paymentCollector try { const datatoken = new Datatoken(web3) - paymentCollector = await datatoken.getPaymentCollector( - asset?.datatokens[0].address + setPaymentCollector( + await datatoken.getPaymentCollector(ddo.datatokens[0].address) ) - setPaymentCollector(paymentCollector) } catch (error) { LoggerInstance.error( '[EditMetadata: getInitialPaymentCollector]',