From 17277a645020bf13bef9aaf1c1292f2b1a7cea02 Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Wed, 11 Dec 2019 20:20:53 -0500 Subject: Remove getOptionsArray --- ext/bg/js/settings/dictionaries.js | 4 ++-- ext/bg/js/settings/main.js | 5 ----- 2 files changed, 2 insertions(+), 7 deletions(-) (limited to 'ext/bg/js/settings') diff --git a/ext/bg/js/settings/dictionaries.js b/ext/bg/js/settings/dictionaries.js index a7205ae5..381d1ae2 100644 --- a/ext/bg/js/settings/dictionaries.js +++ b/ext/bg/js/settings/dictionaries.js @@ -531,7 +531,7 @@ async function onDictionaryPurge(e) { dictionarySpinnerShow(true); await utilDatabasePurge(); - for (const options of toIterable(await getOptionsArray())) { + for (const {options} of toIterable((await apiOptionsGetFull()).profiles)) { options.dictionaries = utilBackgroundIsolate({}); options.general.mainDictionary = ''; } @@ -593,7 +593,7 @@ async function onDictionaryImport(e) { } const {result, errors} = await utilDatabaseImport(files[i], updateProgress, importDetails); - for (const options of toIterable(await getOptionsArray())) { + for (const {options} of toIterable((await apiOptionsGetFull()).profiles)) { const dictionaryOptions = SettingsDictionaryListUI.createDictionaryOptions(); dictionaryOptions.enabled = true; options.dictionaries[result.title] = dictionaryOptions; diff --git a/ext/bg/js/settings/main.js b/ext/bg/js/settings/main.js index 0fd9cb23..c5298dd4 100644 --- a/ext/bg/js/settings/main.js +++ b/ext/bg/js/settings/main.js @@ -16,11 +16,6 @@ * along with this program. If not, see . */ -async function getOptionsArray() { - const optionsFull = await apiOptionsGetFull(); - return optionsFull.profiles.map((profile) => profile.options); -} - async function formRead(options) { options.general.enable = $('#enable').prop('checked'); options.general.showGuide = $('#show-usage-guide').prop('checked'); -- cgit v1.2.3