1
0
mirror of https://github.com/oceanprotocol/react.git synced 2024-06-29 00:57:49 +02:00

getPool fix

* when started before account is available stuff fails
This commit is contained in:
Matthias Kretschmann 2020-08-20 16:55:10 +02:00
parent 695315ce52
commit 8899a3fb8a
Signed by: m
GPG Key ID: 606EEEF3C479A91F

View File

@ -76,6 +76,8 @@ function useMetadata(asset?: DID | string | DDO): UseMetadata {
}, [ocean, status])
useEffect(() => {
if (!accountId) return
async function init(): Promise<void> {
if (internalDdo) {
const metadata = await getMetadata()
@ -95,7 +97,7 @@ function useMetadata(asset?: DID | string | DDO): UseMetadata {
setPrice(pool.price)
}, 10000)
return () => clearInterval(interval)
}, [internalDdo])
}, [accountId, internalDdo])
return {
ddo: internalDdo,