From 818eb4766323a687a932cf84d28bcfc7d9bdb7f4 Mon Sep 17 00:00:00 2001 From: Laura Hausmann Date: Thu, 23 Nov 2023 04:33:48 +0100 Subject: [PATCH] hmm --- packages/client/src/components/MkNotes.vue | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/client/src/components/MkNotes.vue b/packages/client/src/components/MkNotes.vue index 2800e350c..59196f804 100644 --- a/packages/client/src/components/MkNotes.vue +++ b/packages/client/src/components/MkNotes.vue @@ -71,11 +71,19 @@ defineExpose({ scrollTop, }); +const fetchedRecently = ref(false); + setInterval(() => { - if (!tlEl.value) return; + if (!tlEl.value || fetchedRecently.value) return; const viewport = document.documentElement.clientHeight; const left = document.documentElement.scrollHeight - document.documentElement.scrollTop; - if (left <= viewport * 3) pagingComponent.value.fetchMore(); + if (left <= viewport * 3) { + pagingComponent.value.fetchMore(); + fetchedRecently.value = true; + setTimeout(() => { + fetchedRecently.value = false; + }, 500); + } }, 100);