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

no loading spinner on refetch pool shares

This commit is contained in:
Matthias Kretschmann 2021-09-06 12:38:14 +02:00
parent 852e71f17a
commit c9f56e9a46
Signed by: m
GPG Key ID: 606EEEF3C479A91F
2 changed files with 3 additions and 4 deletions

View File

@ -88,7 +88,7 @@ export default function Stats({
} }
} }
getAccountTVL() getAccountTVL()
}, [publishedAssets]) }, [publishedAssets, accountId, chainIds])
return ( return (
<div className={styles.stats}> <div className={styles.stats}>

View File

@ -210,7 +210,6 @@ export default function PoolShares({
const fetchPoolSharesData = useCallback(async () => { const fetchPoolSharesData = useCallback(async () => {
try { try {
setLoading(true)
const data = await getPoolSharesData(accountId, chainIds) const data = await getPoolSharesData(accountId, chainIds)
const newAssets = await getPoolSharesAssets(data) const newAssets = await getPoolSharesAssets(data)
@ -219,14 +218,14 @@ export default function PoolShares({
} }
} catch (error) { } catch (error) {
console.error('Error fetching pool shares: ', error.message) console.error('Error fetching pool shares: ', error.message)
} finally {
setLoading(false)
} }
}, [accountId, assets, chainIds]) }, [accountId, assets, chainIds])
useEffect(() => { useEffect(() => {
async function init() { async function init() {
setLoading(true)
await fetchPoolSharesData() await fetchPoolSharesData()
setLoading(false)
if (dataFetchInterval) return if (dataFetchInterval) return
const interval = setInterval(async () => { const interval = setInterval(async () => {