aboutsummaryrefslogtreecommitdiff
path: root/ext/js/pages/settings/dictionary-import-controller.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/js/pages/settings/dictionary-import-controller.js')
-rw-r--r--ext/js/pages/settings/dictionary-import-controller.js15
1 files changed, 7 insertions, 8 deletions
diff --git a/ext/js/pages/settings/dictionary-import-controller.js b/ext/js/pages/settings/dictionary-import-controller.js
index afa45899..c7b72110 100644
--- a/ext/js/pages/settings/dictionary-import-controller.js
+++ b/ext/js/pages/settings/dictionary-import-controller.js
@@ -19,7 +19,6 @@
* DictionaryController
* DictionaryDatabase
* DictionaryImporter
- * ObjectPropertyAccessor
*/
class DictionaryImportController {
@@ -213,12 +212,12 @@ class DictionaryImportController {
const profileCount = optionsFull.profiles.length;
for (let i = 0; i < profileCount; ++i) {
const {options} = optionsFull.profiles[i];
- const value = DictionaryController.createDefaultDictionarySettings(true);
- const path1 = ObjectPropertyAccessor.getPathString(['profiles', i, 'options', 'dictionaries', title]);
- targets.push({action: 'set', path: path1, value});
+ const value = DictionaryController.createDefaultDictionarySettings(title, true);
+ const path1 = `profiles[${i}].options.dictionaries`;
+ targets.push({action: 'push', path: path1, items: [value]});
if (sequenced && options.general.mainDictionary === '') {
- const path2 = ObjectPropertyAccessor.getPathString(['profiles', i, 'options', 'general', 'mainDictionary']);
+ const path2 = `profiles[${i}].options.general.mainDictionary`;
targets.push({action: 'set', path: path2, value: title});
}
}
@@ -230,9 +229,9 @@ class DictionaryImportController {
const targets = [];
const profileCount = optionsFull.profiles.length;
for (let i = 0; i < profileCount; ++i) {
- const path1 = ObjectPropertyAccessor.getPathString(['profiles', i, 'options', 'dictionaries']);
- targets.push({action: 'set', path: path1, value: {}});
- const path2 = ObjectPropertyAccessor.getPathString(['profiles', i, 'options', 'general', 'mainDictionary']);
+ const path1 = `profiles[${i}].options.dictionaries`;
+ targets.push({action: 'set', path: path1, value: []});
+ const path2 = `profiles[${i}].options.general.mainDictionary`;
targets.push({action: 'set', path: path2, value: ''});
}
return await this._modifyGlobalSettings(targets);