From ace3a9a8bb5edfb640201e549d55c1d39b6e2445 Mon Sep 17 00:00:00 2001 From: Peter Repukat Date: Sat, 9 Sep 2023 13:27:12 +0200 Subject: [PATCH] Fix page increasing indefinitely if scrolled to end --- frontend/src/routes/[...catchAll]/+page.svelte | 1 + 1 file changed, 1 insertion(+) diff --git a/frontend/src/routes/[...catchAll]/+page.svelte b/frontend/src/routes/[...catchAll]/+page.svelte index a6b71ae..24637c5 100644 --- a/frontend/src/routes/[...catchAll]/+page.svelte +++ b/frontend/src/routes/[...catchAll]/+page.svelte @@ -56,6 +56,7 @@ let loadingMore = false; const handleInfScroll = (e: Event) => { const tgt = e.target as HTMLElement; if (tgt?.scrollTop >= tgt?.scrollHeight - tgt?.offsetHeight - 2 * 256) { + if (data.dirList.page >= data.dirList.totalPages) return; if (loadingMore) return; loadingMore = true; void goto(`?page=${data.dirList.page + 1}`, {