Skip to content

Commit

Permalink
[#2090] fix infinite loading in DRep Directory
Browse files Browse the repository at this point in the history
  • Loading branch information
j-dyczka committed Oct 3, 2024
1 parent 2be0dab commit 384f59b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ changes.

- Add missing testIds for submitted votes [Issue 1875](https://github.com/IntersectMBO/govtool/issues/1875)
- Provide workaround for iOS for downloading metadata on iOS [Issue 1989](https://github.com/IntersectMBO/govtool/issues/1989)
- Fix infinite loading in DRep Directory [Issue 2090](https://github.com/IntersectMBO/govtool/issues/2090)

### Changed

Expand Down
10 changes: 5 additions & 5 deletions govtool/frontend/src/hooks/queries/useGetDRepListQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ export const useGetDRepListInfiniteQuery = (
pendingTransaction.registerAsDrep ||
pendingTransaction.retireAsDirectVoter ||
pendingTransaction.retireAsDrep
)?.transactionHash,
filters,
searchPhrase,
sorting,
status,
)?.transactionHash ?? 'noPendingTransaction',
filters.length ? filters : "",
searchPhrase ?? "",
sorting ?? "",
status?.length ? status : "",
],
async ({ pageParam = 0 }) =>
getDRepList({
Expand Down
4 changes: 2 additions & 2 deletions govtool/frontend/src/pages/DRepDirectoryContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ export const DRepDirectoryContent: FC<DRepDirectoryContentProps> = ({
dataActionsBarProps;

useEffect(() => {
setChosenSorting(DRepListSort.Random);
}, [setChosenSorting]);
if (!chosenSorting) setChosenSorting(DRepListSort.Random);
}, [chosenSorting, setChosenSorting]);

const { delegate, isDelegating } = useDelegateTodRep();

Expand Down

0 comments on commit 384f59b

Please sign in to comment.