chore(webui): make add mods behave more like adding items
This commit is contained in:
parent
8b0ba0b84a
commit
27c4b81a9e
@ -1260,6 +1260,8 @@ function doAcquireMod() {
|
||||
$("#mod-to-acquire").addClass("is-invalid").focus();
|
||||
return;
|
||||
}
|
||||
const count = parseInt($("#mod-count").val());
|
||||
if (count != 0) {
|
||||
revalidateAuthz(() => {
|
||||
$.post({
|
||||
url: "/custom/addItems?" + window.authz,
|
||||
@ -1267,14 +1269,19 @@ function doAcquireMod() {
|
||||
data: JSON.stringify([
|
||||
{
|
||||
ItemType: uniqueName,
|
||||
ItemCount: parseInt($("#mod-count").val())
|
||||
ItemCount: count
|
||||
}
|
||||
])
|
||||
}).done(function () {
|
||||
document.getElementById("mod-to-acquire").value = "";
|
||||
if (count > 0) {
|
||||
toast(loc("code_succAdded"));
|
||||
} else {
|
||||
toast(loc("code_succRemoved"));
|
||||
}
|
||||
updateInventory();
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
const uiConfigs = [...$("#server-settings input[id]")].map(x => x.id);
|
||||
|
Loading…
x
Reference in New Issue
Block a user