Skip to content

Commit

Permalink
fix: pagination in pools page (#63)
Browse files Browse the repository at this point in the history
  • Loading branch information
anukulpandey authored Jul 30, 2024
1 parent 36fb988 commit 13a83bd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/hooks/poolHooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,16 +184,18 @@ export const usePoolTransactionSubscription = (
): {data:PoolTransactionQuery, loading:boolean} => {
const [data, setData] = useState<PoolTransactionQuery|undefined>();
const [loading, setLoading] = useState<boolean>(true);

const queryObj = getPoolTransactionQry(address, type, limit, pageIndex);
const TRIGGER = useObservableState(network.getLatestBlockContractEvents$(address?[address]:[]));

useEffect(() => {
const fetchResponse = async (): Promise<void> => {
const response = await graphqlRequest(httpClient, queryObj);
setData(response.data.data);
setLoading(false);
};
fetchResponse();
}, [TRIGGER]);
}, [TRIGGER,pageIndex,limit,type,address]);

if (httpClient === undefined) {
return [undefined, true] as any;
Expand Down

0 comments on commit 13a83bd

Please sign in to comment.