From ba5a4f9a04d519a81d4f4174121d45b74828b553 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Sza=C5=82owski?= Date: Thu, 31 Oct 2024 17:05:52 +0100 Subject: [PATCH] fix(#2285): fix infinite DRep list loading --- CHANGELOG.md | 2 +- govtool/frontend/src/context/dataActionsBar.tsx | 6 ++++-- govtool/frontend/src/hooks/queries/useGetDRepListQuery.ts | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) 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 ?? "",