Skip to content

Commit

Permalink
Update index.jsx
Browse files Browse the repository at this point in the history
  • Loading branch information
halfmanbear committed Aug 8, 2024
1 parent 0f46474 commit 56a7c98
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions src/pages/Generator/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,22 @@ export function Generator() {

useEffect(() => {
const extractPrinterName = (printer) => {
return printer.split(' (')[0];
return printer.split(' (')[0].replace(' ', ''); // Remove spaces for matching
};

const filtered = processesList.filter(process => {
const processPrinterName = process.identifier.split('@')[1].split(' (')[0];
const printerMatch = selectedPrinters.some(printer => extractPrinterName(printer) === processPrinterName);
const filamentMatch = selectedFilament.some(filament => process.identifier.includes(filament));
console.log(`Process: ${process.identifier}, Printer Match: ${printerMatch}, Filament Match: ${filamentMatch}`); // Debug point: Verify matching logic
const processPrinterName = process.identifier.split('@')[1].split(' (')[0].replace(' ', '');
const printerMatch = selectedPrinters.some(printer => {
const printerName = extractPrinterName(printer);
console.log(`Comparing printer name: ${printerName} with process printer name: ${processPrinterName}`);
return printerName === processPrinterName;
});
const filamentMatch = selectedFilament.some(filament => {
const filamentName = filament.replace(' ', '');
console.log(`Checking if process identifier: ${process.identifier} includes filament name: ${filamentName}`);
return process.identifier.includes(filamentName);
});
console.log(`Process: ${process.identifier}, Printer Match: ${printerMatch}, Filament Match: ${filamentMatch}`);
return printerMatch && filamentMatch;
});

Expand Down

0 comments on commit 56a7c98

Please sign in to comment.