mirror of
https://github.com/oceanprotocol/react.git
synced 2024-07-01 06:02:20 +02: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])
|
||||
|
||||
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,
|
||||
|
|
Loading…
Reference in New Issue
Block a user