chore(webui): say "successfully removed" when using a negative quantity
All checks were successful
Build / build (18) (push) Successful in 46s
Build / build (18) (pull_request) Successful in 43s
Build / build (20) (push) Successful in 1m8s
Build / build (22) (push) Successful in 1m9s
Build / build (20) (pull_request) Successful in 1m6s
Build / build (22) (pull_request) Successful in 1m7s

This commit is contained in:
Sainan 2025-03-22 09:12:47 +01:00
parent aa95074ee0
commit 6240636552
2 changed files with 20 additions and 12 deletions

View File

@ -812,20 +812,27 @@ function doAcquireMiscItems() {
$("#miscitem-type").addClass("is-invalid").focus();
return;
}
revalidateAuthz(() => {
$.post({
url: "/custom/addItems?" + window.authz,
contentType: "application/json",
data: JSON.stringify([
{
ItemType: uniqueName,
ItemCount: parseInt($("#miscitem-count").val())
const count = parseInt($("#miscitem-count").val());
if (count != 0) {
revalidateAuthz(() => {
$.post({
url: "/custom/addItems?" + window.authz,
contentType: "application/json",
data: JSON.stringify([
{
ItemType: uniqueName,
ItemCount: count
}
])
}).done(function () {
if (count > 0) {
toast(loc("code_succAdded"));
} else {
toast(loc("code_succRemoved"));
}
])
}).done(function () {
toast(loc("code_succAdded"));
});
});
});
}
}
function doAcquireRiven() {

View File

@ -28,6 +28,7 @@ dict = {
code_succRankUp: `Successfully ranked up.`,
code_noEquipmentToRankUp: `No equipment to rank up.`,
code_succAdded: `Successfully added.`,
code_succRemoved: `Successfully removed.`,
code_buffsNumber: `Number of buffs`,
code_cursesNumber: `Number of curses`,
code_rerollsNumber: `Number of rerolls`,