send only the necessary keys

This commit is contained in:
tophf 2022-01-28 18:31:56 +03:00
parent 8b997ff237
commit 2e7f7d0f62
2 changed files with 5 additions and 3 deletions

View File

@ -157,7 +157,7 @@ const styleMan = (() => {
},
/** @returns {Promise<Object<string,StyleObj[]>>}>} */
async getAllOrdered() {
async getAllOrdered(keys) {
if (ready.then) await ready;
const res = mapObj(orderWrap.value, group => group.map(uuid2style));
if (res.main.length + res.prio.length < dataMap.size) {
@ -167,7 +167,9 @@ const styleMan = (() => {
}
}
}
return res;
return keys
? mapObj(res, group => group.map(style => mapObj(style, null, keys)))
: res;
},
getOrder: () => orderWrap.value,

View File

@ -10,7 +10,7 @@ async function InjectionOrder(show = true) {
return messageBoxProxy.close();
}
const SEL_ENTRY = '.injection-order-entry';
const groups = await API.styles.getAllOrdered();
const groups = await API.styles.getAllOrdered(['_id', 'id', 'name', 'enabled']);
const ols = {};
const parts = {};
const entry = $create('li' + SEL_ENTRY, [