chore(webui): say "successfully removed" when using a negative quantity (#1271)
All checks were successful
Build / build (18) (push) Successful in 1m9s
Build / build (20) (push) Successful in 41s
Build Docker image / docker (push) Successful in 32s
Build / build (22) (push) Successful in 1m12s

Reviewed-on: #1271
This commit is contained in:
Sainan 2025-03-22 03:37:06 -07:00
parent 468ede680a
commit beb02bffb0
2 changed files with 20 additions and 12 deletions

View File

@ -812,20 +812,27 @@ function doAcquireMiscItems() {
$("#miscitem-type").addClass("is-invalid").focus(); $("#miscitem-type").addClass("is-invalid").focus();
return; return;
} }
revalidateAuthz(() => { const count = parseInt($("#miscitem-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($("#miscitem-count").val()) {
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() { function doAcquireRiven() {

View File

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