From 93a2ee127763cd3ca8ca64aea36b0e92ddde685f Mon Sep 17 00:00:00 2001 From: WithoutPants <53250216+WithoutPants@users.noreply.github.com> Date: Mon, 30 Sep 2024 17:13:57 +1000 Subject: [PATCH] Fix page > total redirecting to first page instead of last (#5321) --- ui/v2.5/src/components/List/util.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/v2.5/src/components/List/util.ts b/ui/v2.5/src/components/List/util.ts index c28a9d2a9da..86aa6c6f67a 100644 --- a/ui/v2.5/src/components/List/util.ts +++ b/ui/v2.5/src/components/List/util.ts @@ -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]); }