From 49b9673d48d50a5ca2adea9b4c2055ae2c88f001 Mon Sep 17 00:00:00 2001 From: whoswhip Date: Mon, 29 Dec 2025 04:26:09 -0500 Subject: [PATCH] feat: implement pagination for user pastes; enhance fetchPage function and update display logic --- .../src/routes/user/[username]/+page.svelte | 60 ++++++++++++++++++- 1 file changed, 57 insertions(+), 3 deletions(-) diff --git a/SharpbinV3.Client/src/routes/user/[username]/+page.svelte b/SharpbinV3.Client/src/routes/user/[username]/+page.svelte index 04e3650..89ee327 100644 --- a/SharpbinV3.Client/src/routes/user/[username]/+page.svelte +++ b/SharpbinV3.Client/src/routes/user/[username]/+page.svelte @@ -1,11 +1,44 @@
{data.user.pastes?.length} paste{data.user.pastes?.length !== 1 ? 's' : ''}{pagination.totalCount} paste{pagination.totalCount !== 1 ? 's' : ''}
- {#if data.user.pastes && data.user.pastes.length > 0} - {#each data.user.pastes as paste} + {#if pastes && pastes.length > 0} + {#each pastes.slice().sort((a, b) => b.uuid.localeCompare(a.uuid)) as paste (paste.uuid)} This user has not created any pastes yet.

{/if}
+ {#if pagination.totalPages && pagination.totalPages > 1} +
+ + + Page {currentPage} of {pagination.totalPages} + + +
+ {/if}