返回提交历史
Modified
static/webui/script.js
+6
-1
XFEstudio/XFESpaceNinjaServer
chore(webui): force account cheat element state after request is done (#2862)
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. Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/2862 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>
43bc1271
代码差异
1 个文件
+6
-1
@@ -3195,13 +3195,16 @@ function doIntrinsicsUnlockAll() {
3195
3195
document.querySelectorAll("#account-cheats input[type=checkbox]").forEach(elm => {
3196
3196
elm.onchange = function () {
3197
3197
revalidateAuthz().then(() => {
3198
const value = elm.checked;
3198
3199
$.post({
3199
3200
url: "/custom/setAccountCheat?" + window.authz,
3200
3201
contentType: "application/json",
3201
3202
data: JSON.stringify({
3202
3203
key: elm.id,
3203
value: elm.checked
3204
value: value
3204
3205
})
3206
}).done(() => {
3207
elm.checked = value;
3205
3208
});
3206
3209
});
3207
3210
};
@@ -3237,6 +3240,8 @@ document.querySelectorAll("#account-cheats .input-group").forEach(grp => {
3237
3240
key: input.id,
3238
3241
value: parseInt(value)
3239
3242
})
3243
}).done(() => {
3244
btn.value = value;
3240
3245
});
3241
3246
});
3242
3247
};