mirror of
https://github.com/oceanprotocol/react.git
synced 2025-02-12 08:31:05 +01:00
getPool fix
* when started before account is available stuff fails
This commit is contained in:
parent
695315ce52
commit
8899a3fb8a
@ -76,6 +76,8 @@ function useMetadata(asset?: DID | string | DDO): UseMetadata {
|
|||||||
}, [ocean, status])
|
}, [ocean, status])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
if (!accountId) return
|
||||||
|
|
||||||
async function init(): Promise<void> {
|
async function init(): Promise<void> {
|
||||||
if (internalDdo) {
|
if (internalDdo) {
|
||||||
const metadata = await getMetadata()
|
const metadata = await getMetadata()
|
||||||
@ -95,7 +97,7 @@ function useMetadata(asset?: DID | string | DDO): UseMetadata {
|
|||||||
setPrice(pool.price)
|
setPrice(pool.price)
|
||||||
}, 10000)
|
}, 10000)
|
||||||
return () => clearInterval(interval)
|
return () => clearInterval(interval)
|
||||||
}, [internalDdo])
|
}, [accountId, internalDdo])
|
||||||
|
|
||||||
return {
|
return {
|
||||||
ddo: internalDdo,
|
ddo: internalDdo,
|
||||||
|
Loading…
Reference in New Issue
Block a user