aboutsummaryrefslogtreecommitdiff
path: root/ext/js/data
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2021-04-03 13:02:49 -0400
committerGitHub <noreply@github.com>2021-04-03 13:02:49 -0400
commita9fe2d03b22a0dd5760019f1325a7a86ebb07b85 (patch)
treeaa2fe04c741c82c0456f44a39139c52988b6c22d /ext/js/data
parent0d2d342cd373798e3daf42799a9f35d974db92f5 (diff)
Update dictionary settings structure (#1587)
* Update dictionary settings structure to use an array instead of an object * Update ensureDictionarySettings implementation * Remove some usage of ObjectPropertyAccessor
Diffstat (limited to 'ext/js/data')
-rw-r--r--ext/js/data/options-util.js16
1 files changed, 15 insertions, 1 deletions
diff --git a/ext/js/data/options-util.js b/ext/js/data/options-util.js
index ca122e89..857ef630 100644
--- a/ext/js/data/options-util.js
+++ b/ext/js/data/options-util.js
@@ -459,7 +459,8 @@ class OptionsUtil {
{async: false, update: this._updateVersion7.bind(this)},
{async: true, update: this._updateVersion8.bind(this)},
{async: false, update: this._updateVersion9.bind(this)},
- {async: true, update: this._updateVersion10.bind(this)}
+ {async: true, update: this._updateVersion10.bind(this)},
+ {async: true, update: this._updateVersion11.bind(this)}
];
}
@@ -786,4 +787,17 @@ class OptionsUtil {
}
return options;
}
+
+ _updateVersion11(options) {
+ // Version 11 changes:
+ // Changed dictionaries to an array.
+ for (const profile of options.profiles) {
+ const dictionariesNew = [];
+ for (const [name, {priority, enabled, allowSecondarySearches, definitionsCollapsible}] of Object.entries(profile.options.dictionaries)) {
+ dictionariesNew.push({name, priority, enabled, allowSecondarySearches, definitionsCollapsible});
+ }
+ profile.options.dictionaries = dictionariesNew;
+ }
+ return options;
+ }
}