feat(config): add configuration window (#70)

This commit is contained in:
2026-05-21 04:16:21 -07:00
committed by GitHub
parent a54f03f0cd
commit dc52bc2fba
287 changed files with 14507 additions and 8134 deletions
+2 -1
View File
@@ -277,7 +277,8 @@ export class KnownWordCacheManager {
}
private isKnownWordCacheEnabled(): boolean {
return this.deps.getConfig().knownWords?.highlightEnabled === true;
const config = this.deps.getConfig();
return config.knownWords?.highlightEnabled === true || config.nPlusOne?.enabled === true;
}
private shouldAddMinedWordsImmediately(): boolean {
+4 -2
View File
@@ -157,7 +157,8 @@ export class AnkiIntegrationRuntime {
}
applyRuntimeConfigPatch(patch: Partial<AnkiConnectConfig>): void {
const wasKnownWordCacheEnabled = this.config.knownWords?.highlightEnabled === true;
const wasKnownWordCacheEnabled =
this.config.knownWords?.highlightEnabled === true || this.config.nPlusOne?.enabled === true;
const previousKnownWordCacheConfig = wasKnownWordCacheEnabled
? this.getKnownWordCacheLifecycleConfig(this.config)
: null;
@@ -207,7 +208,8 @@ export class AnkiIntegrationRuntime {
};
this.config = normalizeAnkiIntegrationConfig(mergedConfig);
this.deps.onConfigChanged?.(this.config);
const nextKnownWordCacheEnabled = this.config.knownWords?.highlightEnabled === true;
const nextKnownWordCacheEnabled =
this.config.knownWords?.highlightEnabled === true || this.config.nPlusOne?.enabled === true;
if (wasKnownWordCacheEnabled && !nextKnownWordCacheEnabled) {
if (this.started) {