fix: skip live gallery inserts for filtered views

Generated-By: PostHog Code
Task-Id: b131c873-6e03-47dd-bf51-c99f01ef1f5f
This commit is contained in:
Georges-Antoine Assi
2026-07-14 09:41:19 -04:00
parent d0e5efc85b
commit 807ae86bcf

View File

@@ -26,6 +26,7 @@ import type { Emitter } from "mitt";
import { inject } from "vue";
import type { ScanStats } from "@/__generated__";
import platformApi from "@/services/api/platform";
import storeGalleryFilter from "@/stores/galleryFilter";
import storePlatforms from "@/stores/platforms";
import storeRoms, { type SimpleRom } from "@/stores/roms";
import storeScanning, { type ScanningPlatform } from "@/stores/scanning";
@@ -37,6 +38,7 @@ export function installScanLifecycle() {
const scanningStore = storeScanning();
const romsStore = storeRoms();
const platformsStore = storePlatforms();
const galleryFilterStore = storeGalleryFilter();
const galleryRomsStore = storeGalleryRoms();
const emitter = inject<Emitter<Events>>("emitter");
@@ -100,7 +102,11 @@ export function installScanLifecycle() {
// If the user is currently looking at the gallery of the platform
// being scanned, fold the new ROM into the visible list.
if (galleryRomsStore.currentPlatform?.id === rom.platform_id) {
if (
galleryRomsStore.currentPlatform?.id === rom.platform_id &&
!galleryFilterStore.searchTerm &&
!galleryFilterStore.isFiltered()
) {
galleryRomsStore.addLiveRom(rom);
}
if (romsStore.currentPlatform?.id === rom.platform_id) {