From 73129c95ba9dcd8a2fdc4828cfd351cd26090e67 Mon Sep 17 00:00:00 2001 From: zurdi Date: Sat, 17 Jun 2023 01:23:01 +0200 Subject: [PATCH] avoid overlapped fetch --- frontend/src/views/Gallery.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/views/Gallery.vue b/frontend/src/views/Gallery.vue index c77b6c53e..f932ea244 100644 --- a/frontend/src/views/Gallery.vue +++ b/frontend/src/views/Gallery.vue @@ -70,7 +70,7 @@ async function scan() { } async function fetchMoreSearch() { - if (searchCursor.value === null) return; + if (searchCursor.value === null || gettingRoms.value) return; gettingRoms.value = true; await fetchRomsApi({ platform: route.params.platform, cursor: searchCursor.value, searchTerm: filter.value }) @@ -100,7 +100,7 @@ function onFilterChange() { } async function fetchMoreRoms(platform) { - if (cursor.value === null) return; + if (cursor.value === null || gettingRoms.value) return; gettingRoms.value = true; await fetchRomsApi({ platform, cursor: cursor.value })