use apiOptionsGet to modify the correct profile
This commit is contained in:
parent
9641747ba1
commit
68179607b3
@ -22,9 +22,7 @@ function apiOptionsGet(optionsContext) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function apiOptionsSet(changedOptions, optionsContext, source) {
|
async function apiOptionsSet(changedOptions, optionsContext, source) {
|
||||||
const backend = utilBackend();
|
let options = await apiOptionsGet(optionsContext);
|
||||||
const {depth} = optionsContext;
|
|
||||||
let options = await apiOptionsGetFull();
|
|
||||||
|
|
||||||
function getValuePaths(obj) {
|
function getValuePaths(obj) {
|
||||||
let valuePaths = [];
|
let valuePaths = [];
|
||||||
@ -63,11 +61,10 @@ async function apiOptionsSet(changedOptions, optionsContext, source) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (let [value, path] of getValuePaths(changedOptions)) {
|
for (let [value, path] of getValuePaths(changedOptions)) {
|
||||||
modifyOption(path, value, options.profiles[depth].options);
|
modifyOption(path, value, options);
|
||||||
}
|
}
|
||||||
|
|
||||||
await optionsSave(options);
|
await apiOptionsSave(source);
|
||||||
backend.onOptionsUpdated(source);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function apiOptionsGetFull() {
|
function apiOptionsGetFull() {
|
||||||
|
Loading…
Reference in New Issue
Block a user