Skip to content

Commit

Permalink
Merge pull request #2286 from IntersectMBO/fix/drep-list-stack-on-loa…
Browse files Browse the repository at this point in the history
…ding

fix(#2285): fix infinite DRep list loading
  • Loading branch information
MSzalowski authored Oct 31, 2024
2 parents 431270a + ba5a4f9 commit 52f1f9a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ changes.

### Fixed

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

### Changed

Expand Down
6 changes: 4 additions & 2 deletions govtool/frontend/src/context/dataActionsBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ const DataActionsBarProvider: FC<ProviderProps> = ({ children }) => {

useEffect(() => {
if (
(userMovedToDifferentAppArea && !userOpenedGADetailsFromCategoryPage) ||
(!pathname.includes("drep_directory") &&
userMovedToDifferentAppArea &&
!userOpenedGADetailsFromCategoryPage) ||
userMovedFromGAListToCategoryPage
) {
resetState();
Expand Down Expand Up @@ -116,7 +118,7 @@ const DataActionsBarProvider: FC<ProviderProps> = ({ children }) => {
);

return (
<DataActionsBarContext.Provider value={contextValue}>
<DataActionsBarContext.Provider value={contextValue} key={pathname}>
{children}
</DataActionsBarContext.Provider>
);
Expand Down
2 changes: 1 addition & 1 deletion govtool/frontend/src/hooks/queries/useGetDRepListQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const useGetDRepListInfiniteQuery = (
pendingTransaction.registerAsDrep ||
pendingTransaction.retireAsDirectVoter ||
pendingTransaction.retireAsDrep
)?.transactionHash ?? 'noPendingTransaction',
)?.transactionHash ?? "noPendingTransaction",
filters.length ? filters : "",
searchPhrase ?? "",
sorting ?? "",
Expand Down

0 comments on commit 52f1f9a

Please sign in to comment.