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

non-web3 fallback for data token output

This commit is contained in:
Matthias Kretschmann 2020-09-09 15:19:10 +02:00
parent 6535e35e0b
commit f1812b389b
Signed by: m
GPG Key ID: 606EEEF3C479A91F

View File

@ -24,6 +24,8 @@ export default function MetaFull({
const [dtSymbol, setDtSymbol] = useState<string>()
useEffect(() => {
if (!ocean) return
async function getDataTokenInfo() {
const name = await ocean.datatokens.getName(dataToken, accountId)
setDtName(name)
@ -31,7 +33,7 @@ export default function MetaFull({
setDtSymbol(symbol)
}
getDataTokenInfo()
}, [])
}, [ocean])
return (
<div className={styles.metaFull}>
@ -50,7 +52,7 @@ export default function MetaFull({
title="Data Token"
content={
<EtherscanLink network="rinkeby" path={`token/${dataToken}`}>
{dtName} - {dtSymbol}
{dtName ? `${dtName} - ${dtSymbol}` : <code>{dataToken}</code>}
</EtherscanLink>
}
/>