diff --git a/CHANGELOG.md b/CHANGELOG.md index 4181941a8..9eb2949b6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,7 +16,7 @@ changes. ### Fixed -- +- Fix infinite DRep list loading [Issue 2285](https://github.com/IntersectMBO/govtool/issues/2285) ### Changed diff --git a/govtool/frontend/src/context/dataActionsBar.tsx b/govtool/frontend/src/context/dataActionsBar.tsx index 5bb3acf32..c6fb920e6 100644 --- a/govtool/frontend/src/context/dataActionsBar.tsx +++ b/govtool/frontend/src/context/dataActionsBar.tsx @@ -75,7 +75,9 @@ const DataActionsBarProvider: FC = ({ children }) => { useEffect(() => { if ( - (userMovedToDifferentAppArea && !userOpenedGADetailsFromCategoryPage) || + (!pathname.includes("drep_directory") && + userMovedToDifferentAppArea && + !userOpenedGADetailsFromCategoryPage) || userMovedFromGAListToCategoryPage ) { resetState(); @@ -116,7 +118,7 @@ const DataActionsBarProvider: FC = ({ children }) => { ); return ( - + {children} ); diff --git a/govtool/frontend/src/hooks/queries/useGetDRepListQuery.ts b/govtool/frontend/src/hooks/queries/useGetDRepListQuery.ts index 562eb4930..c6f0f968b 100644 --- a/govtool/frontend/src/hooks/queries/useGetDRepListQuery.ts +++ b/govtool/frontend/src/hooks/queries/useGetDRepListQuery.ts @@ -33,7 +33,7 @@ export const useGetDRepListInfiniteQuery = ( pendingTransaction.registerAsDrep || pendingTransaction.retireAsDirectVoter || pendingTransaction.retireAsDrep - )?.transactionHash ?? 'noPendingTransaction', + )?.transactionHash ?? "noPendingTransaction", filters.length ? filters : "", searchPhrase ?? "", sorting ?? "",