This commit is contained in:
Laura Hausmann 2023-11-23 04:33:48 +01:00
parent 082d9d8743
commit 818eb47663
No known key found for this signature in database
GPG key ID: D044E84C5BE01605

View file

@ -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);
</script>