From 7ba91a35f0a53351c18450e316d193a86eadd373 Mon Sep 17 00:00:00 2001 From: Sainan <63328889+Sainan@users.noreply.github.com> Date: Mon, 6 Oct 2025 20:49:08 +0200 Subject: [PATCH] chore(webui): force account cheat element state after request is done There's a very slim chance we get an inventory response between sending the setAccountCheat request and receiving the response, in which case the element state would be ingruent. --- static/webui/script.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/static/webui/script.js b/static/webui/script.js index c6400db7..c181fc9b 100644 --- a/static/webui/script.js +++ b/static/webui/script.js @@ -3195,13 +3195,16 @@ function doIntrinsicsUnlockAll() { document.querySelectorAll("#account-cheats input[type=checkbox]").forEach(elm => { elm.onchange = function () { revalidateAuthz().then(() => { + const value = elm.checked; $.post({ url: "/custom/setAccountCheat?" + window.authz, contentType: "application/json", data: JSON.stringify({ key: elm.id, - value: elm.checked + value: value }) + }).done(() => { + elm.checked = value; }); }); }; @@ -3237,6 +3240,8 @@ document.querySelectorAll("#account-cheats .input-group").forEach(grp => { key: input.id, value: parseInt(value) }) + }).done(() => { + btn.value = value; }); }); }; -- 2.47.2