From abdde10b74e30ff5ae8d1a085ce790beb11db2d8 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Mon, 5 May 2025 16:12:41 +0400 Subject: [PATCH] refac --- src/lib/components/admin/Users/UserList.svelte | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/lib/components/admin/Users/UserList.svelte b/src/lib/components/admin/Users/UserList.svelte index 4567a24b8..41b698864 100644 --- a/src/lib/components/admin/Users/UserList.svelte +++ b/src/lib/components/admin/Users/UserList.svelte @@ -78,6 +78,12 @@ toast.error(`${error}`); return null; }); + + // if the user is deleted and the current page has only one user, go back to the previous page + if (users.length === 1 && page > 1) { + page -= 1; + } + if (res) { getUserList(); }