Skip to content

Commit

Permalink
Fix page increasing indefinitely if scrolled to end
Browse files Browse the repository at this point in the history
  • Loading branch information
Alia5 committed Sep 9, 2023
1 parent 9d039ed commit ace3a9a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions frontend/src/routes/[...catchAll]/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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}`, {
Expand Down

0 comments on commit ace3a9a

Please sign in to comment.