From 16a5b038ee74e2623445d9617e337d612d9b3f93 Mon Sep 17 00:00:00 2001 From: buzzcode2007 <73412182+buzz_lightsnack_2007@users.noreply.github.com> Date: Wed, 3 Apr 2024 08:21:50 +0800 Subject: [PATCH] fix determining state of condition-enable elements --- gui/scripts/windowman.JS | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/gui/scripts/windowman.JS b/gui/scripts/windowman.JS index 9e72e8e..031a521 100644 --- a/gui/scripts/windowman.JS +++ b/gui/scripts/windowman.JS @@ -429,17 +429,9 @@ export default class windowman { input_elements.forEach((input_element) => { if (input_element.getAttribute("data-enable")) { (async () => { - input_element.disabled = !((await secretariat.read( - input_element.getAttribute("data-enable"), - )) != null - ? (typeof (await secretariat.read( - input_element.getAttribute("data-enable"), - ))).includes(`obj`) - ? ( - await secretariat.read( - input_element.getAttribute("data-enable"), - ) - ).length > 0 + input_element.disabled = !((await secretariat.read(input_element.getAttribute("data-enable"))) != null + ? (typeof (await secretariat.read(input_element.getAttribute("data-enable")))).includes(`obj`) + ? (Object.keys(await secretariat.read(input_element.getAttribute("data-enable")))).length > 0 : !!(await secretariat.read( input_element.getAttribute("data-enable"), ))