fix determining state of condition-enable elements

This commit is contained in:
buzzcode2007 2024-04-03 08:21:50 +08:00
parent 907fbe9000
commit 16a5b038ee

View file

@ -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"),
))