forked from OpenWF/SpaceNinjaServer
chore(webui): make add mods behave more like adding items (#1732)
Reviewed-on: OpenWF/SpaceNinjaServer#1732 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>
This commit is contained in:
parent
e59bdcdfbc
commit
26f37f58e5
@ -1260,21 +1260,28 @@ function doAcquireMod() {
|
|||||||
$("#mod-to-acquire").addClass("is-invalid").focus();
|
$("#mod-to-acquire").addClass("is-invalid").focus();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
revalidateAuthz(() => {
|
const count = parseInt($("#mod-count").val());
|
||||||
$.post({
|
if (count != 0) {
|
||||||
url: "/custom/addItems?" + window.authz,
|
revalidateAuthz(() => {
|
||||||
contentType: "application/json",
|
$.post({
|
||||||
data: JSON.stringify([
|
url: "/custom/addItems?" + window.authz,
|
||||||
{
|
contentType: "application/json",
|
||||||
ItemType: uniqueName,
|
data: JSON.stringify([
|
||||||
ItemCount: parseInt($("#mod-count").val())
|
{
|
||||||
|
ItemType: uniqueName,
|
||||||
|
ItemCount: count
|
||||||
|
}
|
||||||
|
])
|
||||||
|
}).done(function () {
|
||||||
|
if (count > 0) {
|
||||||
|
toast(loc("code_succAdded"));
|
||||||
|
} else {
|
||||||
|
toast(loc("code_succRemoved"));
|
||||||
}
|
}
|
||||||
])
|
updateInventory();
|
||||||
}).done(function () {
|
});
|
||||||
document.getElementById("mod-to-acquire").value = "";
|
|
||||||
updateInventory();
|
|
||||||
});
|
});
|
||||||
});
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const uiConfigs = [...$("#server-settings input[id]")].map(x => x.id);
|
const uiConfigs = [...$("#server-settings input[id]")].map(x => x.id);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user