Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions frontend/src/v2/components/Dialogs/DeleteRomDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import storeRoms, { type SimpleRom } from "@/stores/roms";
import type { Events } from "@/types/emitter";
import { useSnackbar } from "@/v2/composables/useSnackbar";
import storeGalleryRoms from "@/v2/stores/galleryRoms";
import storeGallerySelection from "@/v2/stores/gallerySelection";

defineOptions({ inheritAttrs: false });

Expand All @@ -24,6 +25,7 @@ const route = useRoute();
const show = ref(false);
const romsStore = storeRoms();
const galleryRomsStore = storeGalleryRoms();
const gallerySelectionStore = storeGallerySelection();
const roms = ref<SimpleRom[]>([]);
const romsToDeleteFromFs = ref<number[]>([]);
const excludeOnDelete = ref(false);
Expand Down Expand Up @@ -101,6 +103,11 @@ async function deleteRoms() {
}
}
romsStore.resetSelection();
// Drop the deleted ROMs from the v2 gallery selection too — otherwise
// the SelectionBar stays open pointing at rows that no longer exist,
// and re-running an action 404s. removeIds only touches the deleted
// subset, so a partial delete keeps the rest of the selection intact.
gallerySelectionStore.removeIds(roms.value.map((rom) => rom.id));
Comment thread
gantoine marked this conversation as resolved.
Outdated
Comment thread
gantoine marked this conversation as resolved.
Outdated
romsStore.remove(roms.value);
galleryRomsStore.remove(roms.value);
romsStore.setRecentRoms(
Expand Down
Loading