diff --git a/frontend/src/components/Home/Collections.vue b/frontend/src/components/Home/Collections.vue index 25bc5e8f8..648a96cfd 100644 --- a/frontend/src/components/Home/Collections.vue +++ b/frontend/src/components/Home/Collections.vue @@ -30,12 +30,12 @@ function onHover(emitData: { isHovering: boolean; id: number }) { hoveringCollectionId.value = emitData.id; } -const { y: documentY } = useScroll(window, { throttle: 100 }); +const { y: windowY } = useScroll(window, { throttle: 100 }); // Watch for scroll changes and trigger the throttled function -watch(documentY, () => { +watch(windowY, () => { if ( - documentY.value + window.innerHeight >= document.body.scrollHeight - 300 && + windowY.value + window.innerHeight >= document.body.scrollHeight - 300 && visibleCollections.value < props.collections.length ) { visibleCollections.value += 72; diff --git a/frontend/src/views/Gallery/Collection/BaseCollection.vue b/frontend/src/views/Gallery/Collection/BaseCollection.vue index 730676561..d535a0175 100644 --- a/frontend/src/views/Gallery/Collection/BaseCollection.vue +++ b/frontend/src/views/Gallery/Collection/BaseCollection.vue @@ -136,16 +136,15 @@ function onGameTouchEnd() { clearTimeout(timeout); } -const { y: documentY } = useScroll(window, { throttle: 500 }); +const { y: windowY } = useScroll(window, { throttle: 500 }); -watch(documentY, () => { +watch(windowY, () => { clearTimeout(timeout); window.setTimeout(async () => { - scrolledToTop.value = documentY.value === 0; + scrolledToTop.value = windowY.value === 0; if ( - documentY.value + window.innerHeight >= - document.body.scrollHeight - 300 && + windowY.value + window.innerHeight >= document.body.scrollHeight - 300 && fetchTotalRoms.value > filteredRoms.value.length ) { await fetchRoms(); diff --git a/frontend/src/views/Gallery/Platform.vue b/frontend/src/views/Gallery/Platform.vue index d42658717..9d8815842 100644 --- a/frontend/src/views/Gallery/Platform.vue +++ b/frontend/src/views/Gallery/Platform.vue @@ -116,16 +116,15 @@ function onGameTouchEnd() { clearTimeout(timeout); } -const { y: documentY } = useScroll(window, { throttle: 500 }); +const { y: windowY } = useScroll(window, { throttle: 500 }); -watch(documentY, () => { +watch(windowY, () => { clearTimeout(timeout); window.setTimeout(async () => { - scrolledToTop.value = documentY.value === 0; + scrolledToTop.value = windowY.value === 0; if ( - documentY.value + window.innerHeight >= - document.body.scrollHeight - 300 && + windowY.value + window.innerHeight >= document.body.scrollHeight - 300 && fetchTotalRoms.value > filteredRoms.value.length ) { await fetchRoms(); diff --git a/frontend/src/views/Gallery/Search.vue b/frontend/src/views/Gallery/Search.vue index 26e3049af..f2bb39a70 100644 --- a/frontend/src/views/Gallery/Search.vue +++ b/frontend/src/views/Gallery/Search.vue @@ -114,16 +114,15 @@ function fetchRoms() { }); } -const { y: documentY } = useScroll(window, { throttle: 500 }); +const { y: windowY } = useScroll(window, { throttle: 500 }); -watch(documentY, () => { +watch(windowY, () => { clearTimeout(timeout); window.setTimeout(async () => { - scrolledToTop.value = documentY.value === 0; + scrolledToTop.value = windowY.value === 0; if ( - documentY.value + window.innerHeight >= - document.body.scrollHeight - 300 && + windowY.value + window.innerHeight >= document.body.scrollHeight - 300 && fetchTotalRoms.value > filteredRoms.value.length ) { await fetchRoms(); diff --git a/frontend/src/views/Settings/LibraryManagement.vue b/frontend/src/views/Settings/LibraryManagement.vue index aee58c1bc..a98df583b 100644 --- a/frontend/src/views/Settings/LibraryManagement.vue +++ b/frontend/src/views/Settings/LibraryManagement.vue @@ -161,7 +161,7 @@ function resetMissingRoms() { galleryFilterStore.resetFilters(); } -const { y: documentY } = useScroll(window, { throttle: 500 }); +const { y: windowY } = useScroll(window, { throttle: 500 }); // Watch for tab changes and update URL watch(tab, (newTab) => { @@ -185,14 +185,13 @@ watch( { immediate: true }, ); -watch(documentY, () => { +watch(windowY, () => { clearTimeout(timeout); window.setTimeout(async () => { - scrolledToTop.value = documentY.value === 0; + scrolledToTop.value = windowY.value === 0; if ( - documentY.value + window.innerHeight >= - document.body.scrollHeight - 300 && + windowY.value + window.innerHeight >= document.body.scrollHeight - 300 && fetchTotalRoms.value > filteredRoms.value.length ) { await fetchRoms();