mirror of
https://github.com/oceanprotocol/react.git
synced 2024-11-25 11:28:46 +01:00
Merge pull request #163 from oceanprotocol/fix/disablePriceInterval
disable price interval
This commit is contained in:
commit
02b214b00a
@ -103,21 +103,21 @@ function useMetadata(asset?: DID | string | DDO): UseMetadata {
|
||||
}
|
||||
init()
|
||||
|
||||
const interval = setInterval(async () => {
|
||||
if (
|
||||
!internalDdo ||
|
||||
status !== 1 ||
|
||||
networkId !== (config as ConfigHelperConfig).networkId
|
||||
)
|
||||
return
|
||||
// const interval = setInterval(async () => {
|
||||
// if (
|
||||
// !internalDdo ||
|
||||
// status !== 1 ||
|
||||
// networkId !== (config as ConfigHelperConfig).networkId
|
||||
// )
|
||||
// return
|
||||
|
||||
const priceLive = await getPrice(internalDdo.dataToken)
|
||||
priceLive && setPrice(priceLive)
|
||||
}, 10000)
|
||||
// const priceLive = await getPrice(internalDdo.dataToken)
|
||||
// priceLive && setPrice(priceLive)
|
||||
// }, 10000)
|
||||
|
||||
return () => {
|
||||
clearInterval(interval)
|
||||
}
|
||||
// return () => {
|
||||
// clearInterval(interval)
|
||||
// }
|
||||
}, [status, networkId, config, internalDdo, getMetadata, getPrice])
|
||||
|
||||
return {
|
||||
|
Loading…
Reference in New Issue
Block a user