mirror of
https://iceshrimp.dev/crimekillz/trashposs
synced 2024-11-22 00:43:49 +01:00
[client] Adjust timeline prefetch parameters
This commit is contained in:
parent
ff55cad0fb
commit
c742729796
@ -54,7 +54,7 @@ const props = defineProps<{
|
||||
const pagingComponent = ref<InstanceType<typeof MkPagination>>();
|
||||
|
||||
const interval = ref<NodeJS.Timer>();
|
||||
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);
|
||||
|
Loading…
Reference in New Issue
Block a user