summaryrefslogtreecommitdiff
path: root/ext/js/pages
diff options
context:
space:
mode:
authorStefanVukovic99 <stefanvukovic44@gmail.com>2024-03-03 05:46:32 +0100
committerGitHub <noreply@github.com>2024-03-03 04:46:32 +0000
commit202949cf765cec4175aeb1b5b667dedcc0e9ba6f (patch)
tree68bdab0ef76953b89e924a93209bc07b801e4561 /ext/js/pages
parenteea059388893adf728c8d8418042f4a77ed3adaa (diff)
enable new dicts only on added profile (#752)
Diffstat (limited to 'ext/js/pages')
-rw-r--r--ext/js/pages/settings/dictionary-import-controller.js4
1 files changed, 3 insertions, 1 deletions
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]});