diff --git a/frontend/src/views/Gallery.vue b/frontend/src/views/Gallery.vue index cfe021454..2fc938c35 100644 --- a/frontend/src/views/Gallery.vue +++ b/frontend/src/views/Gallery.vue @@ -84,18 +84,6 @@ async function fetchMoreSearch() { }); } -function onFilterChange() { - searchCursor.value = ""; - searchRoms.value = []; - - if (galleryFilter.value === "") { - filteredRoms.value = roms.value; - return; - } - - fetchMoreSearch(); -} - async function fetchMoreRoms(platform) { if (cursor.value === null || gettingRoms.value) return; @@ -114,15 +102,16 @@ async function fetchMoreRoms(platform) { }); } -function onListScroll({ target }) { - if (cursor.value === null && searchCursor.value === null) return; +function onFilterChange() { + searchCursor.value = ""; + searchRoms.value = []; - // If we are at the bottom of the page, fetch more roms - if (target.scrollTop + target.offsetHeight >= target.scrollHeight) { - galleryFilter.value - ? fetchMoreSearch() - : fetchMoreRoms(route.params.platform); + if (galleryFilter.value === "") { + filteredRoms.value = roms.value; + return; } + + fetchMoreSearch(); } function onGridScroll() { @@ -207,18 +196,15 @@ onBeforeRouteUpdate(async (to, _) => { :thickness="1" />
- -