Skip to content

Commit

Permalink
Fix page > total redirecting to first page instead of last (#5321)
Browse files Browse the repository at this point in the history
  • Loading branch information
WithoutPants authored Sep 30, 2024
1 parent be6431a commit 93a2ee1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ui/v2.5/src/components/List/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ export function useEnsureValidPage(
const totalPages = Math.ceil(totalCount / filter.itemsPerPage);

if (totalPages > 0 && filter.currentPage > totalPages) {
setFilter((prevFilter) => prevFilter.changePage(1));
setFilter((prevFilter) => prevFilter.changePage(totalPages));
}
}, [filter, totalCount, setFilter]);
}

0 comments on commit 93a2ee1

Please sign in to comment.