aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsiikamiika <siikamiika@users.noreply.github.com>2019-10-27 23:34:50 +0200
committersiikamiika <siikamiika@users.noreply.github.com>2019-10-27 23:34:50 +0200
commit68179607b3ac8ed34f32a4a7699fb95c7826249b (patch)
tree0bc0efa787c7358a3f1b2edcfa5a72e685686eaf
parent9641747ba173eb6cc64b5881759d225253935e4a (diff)
use apiOptionsGet to modify the correct profile
-rw-r--r--ext/bg/js/api.js9
1 files changed, 3 insertions, 6 deletions
diff --git a/ext/bg/js/api.js b/ext/bg/js/api.js
index 6c109614..14fc0279 100644
--- a/ext/bg/js/api.js
+++ b/ext/bg/js/api.js
@@ -22,9 +22,7 @@ function apiOptionsGet(optionsContext) {
}
async function apiOptionsSet(changedOptions, optionsContext, source) {
- const backend = utilBackend();
- const {depth} = optionsContext;
- let options = await apiOptionsGetFull();
+ let options = await apiOptionsGet(optionsContext);
function getValuePaths(obj) {
let valuePaths = [];
@@ -63,11 +61,10 @@ async function apiOptionsSet(changedOptions, optionsContext, source) {
}
for (let [value, path] of getValuePaths(changedOptions)) {
- modifyOption(path, value, options.profiles[depth].options);
+ modifyOption(path, value, options);
}
- await optionsSave(options);
- backend.onOptionsUpdated(source);
+ await apiOptionsSave(source);
}
function apiOptionsGetFull() {