From 2e7f7d0f622882af2b024ab9d14cbdc2c2e9ccdb Mon Sep 17 00:00:00 2001 From: tophf Date: Fri, 28 Jan 2022 18:31:56 +0300 Subject: [PATCH] send only the necessary keys --- background/style-manager.js | 6 ++++-- injection-order/injection-order.js | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/background/style-manager.js b/background/style-manager.js index ac6702bb..3d4f4d9a 100644 --- a/background/style-manager.js +++ b/background/style-manager.js @@ -157,7 +157,7 @@ const styleMan = (() => { }, /** @returns {Promise>}>} */ - 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, diff --git a/injection-order/injection-order.js b/injection-order/injection-order.js index 8a5d8f67..6d325697 100644 --- a/injection-order/injection-order.js +++ b/injection-order/injection-order.js @@ -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, [