Skip to content

Commit

Permalink
fix: wait for height load
Browse files Browse the repository at this point in the history
  • Loading branch information
belopash committed May 16, 2024
1 parent 8aaa618 commit 3a2be72
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/api/contracts/vesting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { VESTING_CONTRACT_ABI } from './vesting.abi';

export function useVestings({ addresses }: { addresses?: `0x${string}`[] }) {
const contracts = useContracts();
const { currentHeight } = useSquidNetworkHeightHooks();
const { currentHeight, isLoading: isHeightLoading } = useSquidNetworkHeightHooks();

const { data, isLoading } = useContractReads({
contracts: addresses?.flatMap(address => {
Expand Down Expand Up @@ -57,7 +57,7 @@ export function useVestings({ addresses }: { addresses?: `0x${string}`[] }) {
] as const;
}),
allowFailure: true,
enabled: !!addresses,
enabled: !!addresses && !isHeightLoading,
blockNumber: currentHeight ? BigInt(currentHeight) : undefined,
});

Expand Down

0 comments on commit 3a2be72

Please sign in to comment.