From 262f34a0929abc17263c7b524d561bb9818ac13c Mon Sep 17 00:00:00 2001 From: belopash Date: Fri, 14 Jun 2024 15:54:09 +0500 Subject: [PATCH] fix: fix vestings list --- src/api/contracts/vesting.ts | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/api/contracts/vesting.ts b/src/api/contracts/vesting.ts index 39a7597..bb5e49f 100644 --- a/src/api/contracts/vesting.ts +++ b/src/api/contracts/vesting.ts @@ -73,9 +73,11 @@ export function useVestingContracts({ addresses }: { addresses: `0x${string}`[] initialRelease: Number(unwrapResult(ch[6]) || 0) / 100, expectedTotal: unwrapResult(ch[7])?.toString(), })); - } else { - return res.current; + } else if (!addresses.length) { + return []; } + + return res.current; }, }, }); @@ -94,12 +96,8 @@ export function useVestingContracts({ addresses }: { addresses: `0x${string}`[] | undefined >(undefined); useEffect(() => { - if (!addresses.length) { - res.current = []; - return; - } - - if (!isLoading) res.current = data; + if (isLoading) return; + res.current = data; }, [addresses, data, isLoading]); return {