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:
parent
7279a642f6
commit
a7c1db215e
@ -33,7 +33,7 @@ export default function ExplorerLink({
|
||||
setOceanConfig(oceanInitialConfig)
|
||||
setUrl(oceanInitialConfig?.explorerUri)
|
||||
}
|
||||
if (ocean === undefined) {
|
||||
if (oceanConfig === undefined) {
|
||||
initOcean()
|
||||
}
|
||||
}, [config, networkId, ocean])
|
||||
|
@ -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}`
|
||||
}
|
||||
|
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user