From a60a60ab4be782a48a6fa6c6c75f66ee67e61b60 Mon Sep 17 00:00:00 2001 From: Amelia Frost Date: Sun, 29 Mar 2026 00:45:05 -0700 Subject: [PATCH] very minor refactor --- avia_core/customFrameNativeMenu.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/avia_core/customFrameNativeMenu.js b/avia_core/customFrameNativeMenu.js index 1b2cb42..1597718 100644 --- a/avia_core/customFrameNativeMenu.js +++ b/avia_core/customFrameNativeMenu.js @@ -2,16 +2,16 @@ if (window.__customFrameNativeMenu) return; window.__customFrameNativeMenu = true; - function toggleCheckbox(newElem, toggle) { - const tmp = newElem.querySelector("mdui-checkbox"); - if (tmp && tmp !== undefined) { - if (toggle) { - tmp.setAttribute('checked', ''); - tmp.setAttribute('value', 'on'); - } else { - tmp.removeAttribute('checked'); - tmp.setAttribute('value', 'off'); - } + function toggleCheckbox(elem, toggle) { + const checkbox = elem.querySelector("mdui-checkbox"); + if (!checkbox) return; + + if (toggle) { + checkbox.setAttribute('checked', ''); + checkbox.setAttribute('value', 'on'); + } else { + checkbox.removeAttribute('checked'); + checkbox.setAttribute('value', 'off'); } }