mirror of
https://github.com/rommapp/romm.git
synced 2026-11-30 02:22:44 +01:00
fix: skip live gallery inserts for filtered views
Generated-By: PostHog Code Task-Id: b131c873-6e03-47dd-bf51-c99f01ef1f5f
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user