chore(webui): say "successfully removed" when using a negative quantity #1271
@ -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() {
 | 
			
		||||
 | 
			
		||||
@ -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`,
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user