1
0
mirror of https://github.com/oceanprotocol/market.git synced 2024-12-02 05:57:29 +01:00

Setting payment collector inline

This commit is contained in:
Jamie Hewitt 2022-11-17 13:36:58 +03:00
parent 2265d750a5
commit 5ab6b7dc66
2 changed files with 4 additions and 7 deletions

View File

@ -13,13 +13,11 @@ export default function MetaFull({ ddo }: { ddo: Asset }): ReactElement {
useEffect(() => { useEffect(() => {
async function getInitialPaymentCollector() { async function getInitialPaymentCollector() {
let paymentCollector
try { try {
const datatoken = new Datatoken(web3) const datatoken = new Datatoken(web3)
paymentCollector = await datatoken.getPaymentCollector( setPaymentCollector(
ddo.datatokens[0].address await datatoken.getPaymentCollector(ddo.datatokens[0].address)
) )
setPaymentCollector(paymentCollector)
} catch (error) { } catch (error) {
LoggerInstance.error('[MetaFull: getInitialPaymentCollector]', error) LoggerInstance.error('[MetaFull: getInitialPaymentCollector]', error)
} }

View File

@ -47,10 +47,9 @@ export default function Edit({
let paymentCollector let paymentCollector
try { try {
const datatoken = new Datatoken(web3) const datatoken = new Datatoken(web3)
paymentCollector = await datatoken.getPaymentCollector( setPaymentCollector(
asset?.datatokens[0].address await datatoken.getPaymentCollector(ddo.datatokens[0].address)
) )
setPaymentCollector(paymentCollector)
} catch (error) { } catch (error) {
LoggerInstance.error( LoggerInstance.error(
'[EditMetadata: getInitialPaymentCollector]', '[EditMetadata: getInitialPaymentCollector]',