返回提交历史
Modified
static/webui/script.js
+3
-3
XFEstudio/XFESpaceNinjaServer
chore(webui): treat NaN like 0 (#3370)
Closes #3369 Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/3370 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>
78548420
代码差异
1 个文件
+3
-3
@@ -2436,7 +2436,7 @@ function addVaultItem(vaultType) {
2436
2436
const ItemCount = ["VaultMiscItems", "VaultShipDecorations"].includes(vaultType)
2437
2437
? parseInt($(`#${vaultType}-count`).val())
2438
2438
: 1;
2439
if (ItemCount != 0) {
2439
if (ItemCount != 0 && !Number.isNaN(ItemCount)) {
2440
2440
revalidateAuthz().then(() => {
2441
2441
const req = $.post({
2442
2442
url: "/custom/addVaultTypeCount?" + window.authz + "&guildId=" + window.guildId,
@@ -2977,7 +2977,7 @@ function doAcquireCountItems(category) {
2977
2977
return;
2978
2978
}
2979
2979
const count = parseInt($(`#${category}-count`).val());
2980
if (count != 0) {
2980
if (count != 0 && !Number.isNaN(count)) {
2981
2981
revalidateAuthz().then(() => {
2982
2982
$.post({
2983
2983
url: "/custom/addItems?" + window.authz,
@@ -3151,7 +3151,7 @@ function doAcquireMod() {
3151
3151
return;
3152
3152
}
3153
3153
const count = parseInt($("#mod-count").val());
3154
if (count != 0) {
3154
if (count != 0 && !Number.isNaN(count)) {
3155
3155
Promise.all([window.itemListPromise, revalidateAuthz()]).then(([itemList]) => {
3156
3156
$.post({
3157
3157
url: "/custom/addItems?" + window.authz,