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 0d3fe1b
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 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,14 @@ 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 0d3fe1b

Please sign in to comment.