Skip to content

Commit

Permalink
enable new dicts only on added profile
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanVukovic99 committed Mar 1, 2024
1 parent e47a0f4 commit 67f4939
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ext/js/pages/settings/dictionary-import-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -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]});

Expand Down

0 comments on commit 67f4939

Please sign in to comment.