add null value detection when enabling

This commit is contained in:
buzz-lightsnack-2007 2024-03-29 21:45:32 +08:00
parent c4e4f5a29b
commit 314bc40fae

View file

@ -324,12 +324,17 @@ class windowman {
if (input_elements) {
input_elements.forEach((input_element) => {
(async () => {
input_element.disabled =
(await secretariat.read(
input_element.getAttribute("data-enable"),
)) == null;
})();
if (input_element.getAttribute("data-enable")) {
(async () => {
input_element.disabled =
(await secretariat.read(
input_element.getAttribute("data-enable"),
)) == null ||
(await secretariat.read(
input_element.getAttribute("data-enable"),
));
})();
}
});
}
}