diff --git a/public/i18n/de.json b/public/i18n/de.json index af20826..ff1bb86 100644 --- a/public/i18n/de.json +++ b/public/i18n/de.json @@ -654,6 +654,8 @@ "SAVE": "{{count}} Spiele hinzufügen", "SAVE_FAILED": "Der Import konnte nicht gespeichert werden.", "NEW": "Neuer Import", + "SELECT_ALL": "Alle auswählen", + "SELECT_NONE": "Alle abwählen", "LINE": "Zeile {{line}}", "SEARCH_FAILED": "Suche fehlgeschlagen", "SEARCH_AGAIN": "Neu suchen", diff --git a/public/i18n/en.json b/public/i18n/en.json index d584e90..527adff 100644 --- a/public/i18n/en.json +++ b/public/i18n/en.json @@ -654,6 +654,8 @@ "SAVE": "Add {{count}} games", "SAVE_FAILED": "Could not save the import.", "NEW": "New import", + "SELECT_ALL": "Select all", + "SELECT_NONE": "Deselect all", "LINE": "Line {{line}}", "SEARCH_FAILED": "Search failed", "SEARCH_AGAIN": "Search again", diff --git a/src/pages/ImportPage.jsx b/src/pages/ImportPage.jsx index f35e717..693fb04 100644 --- a/src/pages/ImportPage.jsx +++ b/src/pages/ImportPage.jsx @@ -371,6 +371,12 @@ function Review({data, favorite, onSaved, onDone, expireSession}) { return {...choice, candidates, igdbId: candidate.igdbId, platform: preselectPlatform(data.rows[index].platform, candidate.platforms, favorite)}; })), [data.rows, favorite]); + // A line without a match cannot be checked, one in the library only by hand; a hand check stays. + const checkAll = (checked) => setChoices((current) => current.map((choice) => { + const candidate = choice.candidates.find((known) => known.igdbId === choice.igdbId); + const next = checked && (choice.checked || (!!candidate && !candidate.inLibrary)); + return choice.checked === next ? choice : {...choice, checked: next}; + })); const chosen = choices.map((choice, index) => ({choice, row: data.rows[index]})) .filter(({choice}) => choice.checked && choice.igdbId && choice.platform.trim()); @@ -402,7 +408,9 @@ function Review({data, favorite, onSaved, onDone, expireSession}) {

{t('IMPORT.REVIEW_HINT')}

-
+
+ +