Skip to content

Commit

Permalink
fix: hasNextPage and fetchNextPage fix
Browse files Browse the repository at this point in the history
  • Loading branch information
JanJaroszczak committed Apr 23, 2024
1 parent 1797957 commit 6df0295
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions govtool/frontend/src/pages/DRepDirectoryContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,7 @@ export const DRepDirectoryContent: FC<DRepDirectoryContentProps> = ({
const { currentDelegation } = useGetAdaHolderCurrentDelegationQuery(stakeKey);
const inProgressDelegation = pendingTransaction.delegate?.resourceId;

const {
dRepData: myDRepList,
dRepListHasNextPage,
dRepListFetchNextPage,
} = useGetDRepListInfiniteQuery(
const { dRepData: myDRepList } = useGetDRepListInfiniteQuery(
{
searchPhrase: currentDelegation?.dRepView?.startsWith("drep")
? currentDelegation.dRepView
Expand All @@ -61,7 +57,13 @@ export const DRepDirectoryContent: FC<DRepDirectoryContentProps> = ({
{ enabled: !!inProgressDelegation || !!currentDelegation },
);
const myDrep = myDRepList?.[0];
const { dRepData: dRepList, isPreviousData } = useGetDRepListInfiniteQuery(

const {
dRepData: dRepList,
isPreviousData,
dRepListHasNextPage,
dRepListFetchNextPage,
} = useGetDRepListInfiniteQuery(
{
searchPhrase: debouncedSearchText,
sorting: chosenSorting as DRepListSort,
Expand Down

0 comments on commit 6df0295

Please sign in to comment.