feat: add Anki deck dropdown with Yomitan auto-fill in settings (#95)

This commit is contained in:
2026-05-27 23:13:43 -07:00
committed by GitHub
parent 75f9b8a803
commit 8d0535f3ca
24 changed files with 415 additions and 9 deletions
+12 -1
View File
@@ -326,7 +326,18 @@ export class KnownWordCacheManager {
: null;
if (!selectedDeckEntry) {
return null;
const configuredFields = trimmedDeckEntries.flatMap(([, fields]) =>
Array.isArray(fields) ? fields : [],
);
const normalizedFields = [
...new Set(
configuredFields
.map(String)
.map((field) => field.trim())
.filter((field) => field.length > 0),
),
];
return normalizedFields.length > 0 ? normalizedFields : this.getDefaultKnownWordFields();
}
const deckFields = selectedDeckEntry[1];