This commit is contained in:
tamaina 2023-07-17 14:57:00 +00:00
parent d335da5ee4
commit 6152122d43
1 changed files with 6 additions and 15 deletions

View File

@ -182,10 +182,10 @@ watch([() => props.pagination.reversed, $$(scrollableElement)], () => {
scrollObserver = new IntersectionObserver(entries => {
if (!active.value) return; // active
weakBacked = entries[0].intersectionRatio > 0.1;
weakBacked = entries[0].intersectionRatio > 0.02;
}, {
root: scrollableElement,
rootMargin: props.pagination.reversed ? '-1000% 0px 100% 0px' : '100% 0px -1000% 0px',
rootMargin: props.pagination.reversed ? '-100% 0px 100% 0px' : '100% 0px -100% 0px',
threshold: [0, 0.01, 0.02, 0.04, 0.08, 0.1, 0.12],
});
}, { immediate: true });
@ -518,20 +518,11 @@ const prepend = (item: MisskeyEntity): void => {
if (
!isPausingUpdate.value && // /調
queueSize.value === 0 && //
active.value // keepAlive
active.value && // keepAlive
!backed //
) {
if (!backed) {
//
if (items.value.has(item.id)) return; //
unshiftItems([item]);
} else if (!weakBacked) {
// 調
prependQueue(item);
executeQueue();
} else {
//
prependQueue(item);
}
if (items.value.has(item.id)) return; //
unshiftItems([item]);
} else {
prependQueue(item);
}