diff --git a/src/routes/(app)/admin/+page.svelte b/src/routes/(app)/admin/+page.svelte index 92a8315b6..6d153d8a8 100644 --- a/src/routes/(app)/admin/+page.svelte +++ b/src/routes/(app)/admin/+page.svelte @@ -73,10 +73,20 @@ loaded = true; }); - $: paginatedSource = users.slice( - paginatorSettings.page * paginatorSettings.limit, - paginatorSettings.page * paginatorSettings.limit + paginatorSettings.limit - ); + $: paginatedSource = users + .filter((user) => { + if (search === '') { + return true; + } else { + let name = user.name.toLowerCase(); + const query = search.toLowerCase(); + return name.includes(query); + } + }) + .slice( + paginatorSettings.page * paginatorSettings.limit, + paginatorSettings.page * paginatorSettings.limit + paginatorSettings.limit + ); $: paginatorSettings.size = users.length; @@ -174,15 +184,7 @@ - {#each paginatedSource.filter((user) => { - if (search === '') { - return true; - } else { - let name = user.name.toLowerCase(); - const query = search.toLowerCase(); - return name.includes(query); - } - }) as user} + {#each paginatedSource as user}