Skip to content

Commit

Permalink
fix: fix vestings list
Browse files Browse the repository at this point in the history
  • Loading branch information
belopash committed Jun 14, 2024
1 parent 3d2ac8d commit 262f34a
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/api/contracts/vesting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
},
},
});
Expand All @@ -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 {
Expand Down

0 comments on commit 262f34a

Please sign in to comment.