This commit is contained in:
tamaina 2023-07-11 13:23:56 +00:00
parent 28f914f67f
commit b4d532efb4

View file

@ -192,15 +192,11 @@ watch($$(rootEl), () => {
/** /**
* onScrollTop/onScrollBottomで細かく検出する * onScrollTop/onScrollBottomで細かく検出する
*/ */
function onHead() { watch($$(backed), () => {
console.log('onHead'); if (!backed) {
backed = false; executeQueue();
executeQueue(); }
} });
function onBacked() {
backed = true;
}
watch([$$(weakBacked), $$(contentEl)], () => { watch([$$(weakBacked), $$(contentEl)], () => {
if (weakBacked || !contentEl) { if (weakBacked || !contentEl) {
@ -217,9 +213,9 @@ watch([$$(weakBacked), $$(contentEl)], () => {
const onScroll = () => { const onScroll = () => {
if (!document.body.contains(el)) return; if (!document.body.contains(el)) return;
if (checkFn(el, tolerance)) { if (checkFn(el, tolerance)) {
onHead(); backed = false;
} else { } else {
onBacked(); backed = true;
} }
}; };
@ -444,7 +440,7 @@ const prepend = (item: MisskeyEntity): void => {
!isPausingUpdate && // !isPausingUpdate && //
active.value // keepAlive active.value // keepAlive
) { ) {
if (!items.value.has(item.id)) return; // if (items.value.has(item.id)) return; //
unshiftItems([item]); unshiftItems([item]);
} else { } else {
prependQueue(item); prependQueue(item);