diff --git a/packages/client/src/components/MkNotes.vue b/packages/client/src/components/MkNotes.vue index e88f9c45d..129d7dad6 100644 --- a/packages/client/src/components/MkNotes.vue +++ b/packages/client/src/components/MkNotes.vue @@ -54,7 +54,7 @@ const props = defineProps<{ const pagingComponent = ref>(); const interval = ref(); -const lastFetchScrollTop = ref(document.documentElement.clientHeight / 2 * -1); +const lastFetchScrollTop = ref(document.documentElement.clientHeight * -0.5); function scrollTop() { if (!tlEl.value) return; @@ -66,7 +66,8 @@ function setTimer() { interval.value = setInterval(() => { const viewport = document.documentElement.clientHeight; const left = document.documentElement.scrollHeight - document.documentElement.scrollTop; - if (left > viewport * 3 || document.documentElement.scrollTop - lastFetchScrollTop.value < viewport) return; + console.log(document.documentElement.scrollTop - lastFetchScrollTop.value); + if (left > Math.max(viewport * 3, 4000) || document.documentElement.scrollTop - lastFetchScrollTop.value < viewport) return; pagingComponent.value.prefetchMore(); lastFetchScrollTop.value = document.documentElement.scrollTop; }, 100);