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

disable exhaustive-deps warning in Pool context ()

This commit is contained in:
Matthias Kretschmann 2022-02-14 15:23:18 +00:00 committed by GitHub
parent b6dc52c0ab
commit 942ead1b4c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -77,8 +77,6 @@ function PoolProvider({ children }: { children: ReactNode }): ReactElement {
}, [asset?.chainId, asset?.accessDetails?.addressOrId, owner, accountId])
// Helper: start interval fetching
// Having `accountId` as dependency is important for interval to
// change after user account switch.
const initFetchInterval = useCallback(() => {
if (fetchInterval) return
@ -89,6 +87,10 @@ function PoolProvider({ children }: { children: ReactNode }): ReactElement {
)
}, refreshInterval)
setFetchInterval(newInterval)
// Having `accountId` as dependency is important for interval to
// change after user account switch.
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [fetchInterval, fetchAllData, accountId])
useEffect(() => {