Skip to content

Commit 52f1f9a

Browse files
authored
Merge pull request #2286 from IntersectMBO/fix/drep-list-stack-on-loading
fix(#2285): fix infinite DRep list loading
2 parents 431270a + ba5a4f9 commit 52f1f9a

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ changes.
1616

1717
### Fixed
1818

19-
-
19+
- Fix infinite DRep list loading [Issue 2285](https://github.com/IntersectMBO/govtool/issues/2285)
2020

2121
### Changed
2222

govtool/frontend/src/context/dataActionsBar.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,9 @@ const DataActionsBarProvider: FC<ProviderProps> = ({ children }) => {
7575

7676
useEffect(() => {
7777
if (
78-
(userMovedToDifferentAppArea && !userOpenedGADetailsFromCategoryPage) ||
78+
(!pathname.includes("drep_directory") &&
79+
userMovedToDifferentAppArea &&
80+
!userOpenedGADetailsFromCategoryPage) ||
7981
userMovedFromGAListToCategoryPage
8082
) {
8183
resetState();
@@ -116,7 +118,7 @@ const DataActionsBarProvider: FC<ProviderProps> = ({ children }) => {
116118
);
117119

118120
return (
119-
<DataActionsBarContext.Provider value={contextValue}>
121+
<DataActionsBarContext.Provider value={contextValue} key={pathname}>
120122
{children}
121123
</DataActionsBarContext.Provider>
122124
);

govtool/frontend/src/hooks/queries/useGetDRepListQuery.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export const useGetDRepListInfiniteQuery = (
3333
pendingTransaction.registerAsDrep ||
3434
pendingTransaction.retireAsDirectVoter ||
3535
pendingTransaction.retireAsDrep
36-
)?.transactionHash ?? 'noPendingTransaction',
36+
)?.transactionHash ?? "noPendingTransaction",
3737
filters.length ? filters : "",
3838
searchPhrase ?? "",
3939
sorting ?? "",

0 commit comments

Comments
 (0)