a
/ test-build (push) Successful in 1m6s Details

This commit is contained in:
Laura Hausmann 2023-11-23 15:01:34 +01:00
parent 818eb47663
commit eacf726043
Signed by: zotan
GPG Key ID: D044E84C5BE01605
1 changed files with 3 additions and 6 deletions

View File

@ -71,18 +71,15 @@ defineExpose({
scrollTop,
});
const fetchedRecently = ref(false);
const lastFetchPos = ref(0);
setInterval(() => {
if (!tlEl.value || fetchedRecently.value) return;
if (!tlEl.value) return;
const viewport = document.documentElement.clientHeight;
const left = document.documentElement.scrollHeight - document.documentElement.scrollTop;
if (left <= viewport * 3) {
pagingComponent.value.fetchMore();
fetchedRecently.value = true;
setTimeout(() => {
fetchedRecently.value = false;
}, 500);
lastFetchPos.value = document.documentElement.scrollTop;
}
}, 100);
</script>