From 202949cf765cec4175aeb1b5b667dedcc0e9ba6f Mon Sep 17 00:00:00 2001 From: StefanVukovic99 Date: Sun, 3 Mar 2024 05:46:32 +0100 Subject: enable new dicts only on added profile (#752) --- ext/js/pages/settings/dictionary-import-controller.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'ext') diff --git a/ext/js/pages/settings/dictionary-import-controller.js b/ext/js/pages/settings/dictionary-import-controller.js index 13766d80..64d94a52 100644 --- a/ext/js/pages/settings/dictionary-import-controller.js +++ b/ext/js/pages/settings/dictionary-import-controller.js @@ -252,12 +252,14 @@ export class DictionaryImportController { */ async _addDictionarySettings(sequenced, title) { const optionsFull = await this._settingsController.getOptionsFull(); + const profileIndex = this._settingsController.profileIndex; /** @type {import('settings-modifications').Modification[]} */ const targets = []; const profileCount = optionsFull.profiles.length; for (let i = 0; i < profileCount; ++i) { const {options} = optionsFull.profiles[i]; - const value = DictionaryController.createDefaultDictionarySettings(title, true); + const enabled = profileIndex === i; + const value = DictionaryController.createDefaultDictionarySettings(title, enabled); const path1 = `profiles[${i}].options.dictionaries`; targets.push({action: 'push', path: path1, items: [value]}); -- cgit v1.2.3