From 403dcb5e31f313a60d77022caab576b91b394bd9 Mon Sep 17 00:00:00 2001 From: Darshan Date: Mon, 30 Dec 2024 19:24:46 +0530 Subject: [PATCH] fix: total pages count on pagination. --- src/lib/components/pagination.svelte | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/lib/components/pagination.svelte b/src/lib/components/pagination.svelte index 3824a12b8..65968e4ed 100644 --- a/src/lib/components/pagination.svelte +++ b/src/lib/components/pagination.svelte @@ -7,10 +7,11 @@ export let offset: number; export let hidePages = false; - $: totalPages = Math.ceil(sum / limit); $: currentPage = Math.floor(offset / limit + 1); - $: pages = pagination(currentPage, totalPages); + // TODO: check if we even need these now due to Pink V2. + /*$: totalPages = Math.ceil(sum / limit); + $: pages = pagination(currentPage, totalPages); function pagination(page: number, total: number) { const pagesShown = 5; const start = Math.max( @@ -26,7 +27,7 @@ ...Array.from({ length: end + 1 - start }, (_, i) => i + start), ...(end < total - 1 ? ['...', total] : end < total ? [total] : []) ]; - } + }*/ function getLink(page: number): string { const url = new URL($pageStore.url); @@ -40,7 +41,7 @@ } - +