aboutsummaryrefslogtreecommitdiff
path: root/ext/bg/js/api.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-09-07 16:15:18 -0400
committertoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-09-10 20:09:33 -0400
commit05ce350792fd60c1721bff4d0fb971e2bec24818 (patch)
treee9f55d8dd038fd3beaacae98a2a4c748aff1400b /ext/bg/js/api.js
parent4686a31a0a5d30a1b01e3cd2b689d1950c79c940 (diff)
Use apiOptionsSave instead of optionsSave
Diffstat (limited to 'ext/bg/js/api.js')
-rw-r--r--ext/bg/js/api.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/ext/bg/js/api.js b/ext/bg/js/api.js
index 53e25348..a50353c1 100644
--- a/ext/bg/js/api.js
+++ b/ext/bg/js/api.js
@@ -21,6 +21,13 @@ function apiOptionsGet(optionsContext) {
return utilBackend().getOptions(optionsContext);
}
+async function apiOptionsSave() {
+ const backend = utilBackend();
+ const options = await backend.getFullOptions();
+ await optionsSave(options);
+ backend.onOptionsUpdated(options);
+}
+
async function apiTermsFind(text, optionsContext) {
const options = await apiOptionsGet(optionsContext);
const translator = utilBackend().translator;
@@ -132,7 +139,7 @@ async function apiCommandExec(command) {
const optionsContext = {depth: 0};
const options = await apiOptionsGet(optionsContext);
options.general.enable = !options.general.enable;
- await optionsSave(options);
+ await apiOptionsSave();
}
};