From e51d8294b742daf213f5f791ead1df80cf9bae6f Mon Sep 17 00:00:00 2001 From: Sven Efftinge Date: Tue, 4 Oct 2022 07:50:10 +0000 Subject: [PATCH] [admin] don't search all users initially --- components/dashboard/src/admin/UserSearch.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/components/dashboard/src/admin/UserSearch.tsx b/components/dashboard/src/admin/UserSearch.tsx index 3d3a5f20d6e880..89fd7119ebe6ce 100644 --- a/components/dashboard/src/admin/UserSearch.tsx +++ b/components/dashboard/src/admin/UserSearch.tsx @@ -22,9 +22,10 @@ export default function UserSearch() { const [currentUser, setCurrentUserState] = useState(undefined); const pageLength = 50; const [currentPage, setCurrentPage] = useState(1); - useEffect(() => { + const updateCurrentPage = (page: number) => { + setCurrentPage(page); search(); - }, [currentPage]); + }; useEffect(() => { const userId = location.pathname.split("/")[3]; @@ -111,7 +112,7 @@ export default function UserSearch() {