fix: update mass import handling to use filtered and sorted format selections

This commit is contained in:
Sam Chau
2025-01-09 17:10:51 +10:30
parent 9f6aec5d53
commit fc4bda773d

View File

@@ -207,7 +207,16 @@ function FormatPage() {
const handleMassImport = async arr => {
try {
const formatNames = Array.from(selectedItems);
// Get the filtered and sorted formats that were displayed during selection
const filteredFormats = getFilteredAndSortedFormats();
// Convert selected indexes to format file names using the filtered list
const selectedFormats = Array.from(selectedItems).map(
index => filteredFormats[index]
);
const formatNames = selectedFormats.map(format => format.file_name);
await importFormats(arr, formatNames);
Alert.success('Formats imported successfully');
toggleSelectionMode();