From 1cf5795aeeefb89e836c8fa1be0d066d15a77129 Mon Sep 17 00:00:00 2001 From: Sainan <63328889+Sainan@users.noreply.github.com> Date: Fri, 27 Jun 2025 00:42:56 +0200 Subject: [PATCH] prettier --- static/webui/script.js | 54 ++++++++++++++++++++++-------------------- 1 file changed, 28 insertions(+), 26 deletions(-) diff --git a/static/webui/script.js b/static/webui/script.js index 49571189..479f0014 100644 --- a/static/webui/script.js +++ b/static/webui/script.js @@ -1898,34 +1898,36 @@ single.getRoute("/webui/cheats").on("beforeload", function () { url: "/custom/getConfig?" + window.authz, contentType: "application/json", data: JSON.stringify(uiConfigs) - }).done(json => { - //window.is_admin = true; - $(".config-admin-hide").addClass("d-none"); - $(".config-admin-show").removeClass("d-none"); - Object.entries(json).forEach(entry => { - const [key, value] = entry; - var x = document.getElementById(`${key}`); - if (x != null) { - if (x.type == "checkbox") { - x.checked = value; - } else if (x.type == "number") { - x.setAttribute("value", `${value}`); - } - } - }); - }).fail(res => { - if (res.responseText == "Log-in expired") { - revalidateAuthz().then(() => { - if (single.getCurrentPath() == "/webui/cheats") { - single.loadRoute("/webui/cheats"); + }) + .done(json => { + //window.is_admin = true; + $(".config-admin-hide").addClass("d-none"); + $(".config-admin-show").removeClass("d-none"); + Object.entries(json).forEach(entry => { + const [key, value] = entry; + var x = document.getElementById(`${key}`); + if (x != null) { + if (x.type == "checkbox") { + x.checked = value; + } else if (x.type == "number") { + x.setAttribute("value", `${value}`); + } } }); - } else { - //window.is_admin = false; - $(".config-admin-hide").removeClass("d-none"); - $(".config-admin-show").addClass("d-none"); - } - }); + }) + .fail(res => { + if (res.responseText == "Log-in expired") { + revalidateAuthz().then(() => { + if (single.getCurrentPath() == "/webui/cheats") { + single.loadRoute("/webui/cheats"); + } + }); + } else { + //window.is_admin = false; + $(".config-admin-hide").removeClass("d-none"); + $(".config-admin-show").addClass("d-none"); + } + }); } }, 10); });