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

Fix broken explorer links for multinetwork (#761)

* external link get oceanConfing when undefined, use chainId for pools

* pass chainId to editHistory explorerLinks

* remove ddo check from Pool explorer link

* removed chainId verfication from datatoken external link path

* add Gaia-X chainId verification to pool datatoken external link

* add chainId check for Moonbeam
This commit is contained in:
Norbi 2021-07-28 15:51:26 +03:00 committed by GitHub
parent 7279a642f6
commit a7c1db215e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 7 deletions

View File

@ -33,7 +33,7 @@ export default function ExplorerLink({
setOceanConfig(oceanInitialConfig)
setUrl(oceanInitialConfig?.explorerUri)
}
if (ocean === undefined) {
if (oceanConfig === undefined) {
initOcean()
}
}, [config, networkId, ocean])

View File

@ -65,7 +65,7 @@ export default function Pool(): ReactElement {
const data = useStaticQuery(contentQuery)
const content = data.content.edges[0].node.childContentJson.pool
const { accountId, networkId } = useWeb3()
const { accountId } = useWeb3()
const { ocean } = useOcean()
const { isInPurgatory, ddo, owner, price, refreshInterval, isAssetNetwork } =
useAsset()
@ -278,15 +278,15 @@ export default function Pool(): ReactElement {
<Tooltip content={content.tooltips.price} />
<div className={styles.dataTokenLinks}>
<ExplorerLink
networkId={networkId}
networkId={ddo.chainId}
path={`address/${price?.address}`}
>
Pool
</ExplorerLink>
<ExplorerLink
networkId={networkId}
networkId={ddo.chainId}
path={
networkId === 137 || networkId === 1287
ddo.chainId === 2021000 || ddo.chainId === 1287
? `tokens/${ddo.dataToken}`
: `token/${ddo.dataToken}`
}

View File

@ -50,14 +50,14 @@ export default function EditHistory(): ReactElement {
<ul className={styles.history}>
{receipts?.map((receipt) => (
<li key={receipt.id} className={styles.item}>
<ExplorerLink networkId={networkId} path={`/tx/${receipt.tx}`}>
<ExplorerLink networkId={ddo.chainId} path={`/tx/${receipt.tx}`}>
edited{' '}
<Time date={receipt.timestamp.toString()} relative isUnix />
</ExplorerLink>
</li>
))}
<li className={styles.item}>
<ExplorerLink networkId={networkId} path={`/tx/${creationTx}`}>
<ExplorerLink networkId={ddo.chainId} path={`/tx/${creationTx}`}>
published <Time date={ddo.created} relative />
</ExplorerLink>
</li>