diff --git a/static/webui/script.js b/static/webui/script.js index a2a1be52..0c023d44 100644 --- a/static/webui/script.js +++ b/static/webui/script.js @@ -1093,25 +1093,30 @@ function doAddAllMods() { } modsAll = Array.from(modsAll); - // Batch to avoid PayloadTooLargeError - const batches = []; - for (let i = 0; i < modsAll.length; i += 1000) { - batches.push(modsAll.slice(i, i + 1000)); - } - batches.forEach(batch => { - $.post({ - url: "/api/missionInventoryUpdate.php?" + window.authz, - contentType: "text/plain", - data: JSON.stringify({ - RawUpgrades: batch.map(mod => ({ - ItemType: mod, - ItemCount: 21 // To fully upgrade certain arcanes - })) - }) - }).done(function () { - updateInventory(); + if ( + modsAll.length != 0 && + window.confirm("Are you sure you want to add " + modsAll.length + " mods to your account?") + ) { + // Batch to avoid PayloadTooLargeError + const batches = []; + for (let i = 0; i < modsAll.length; i += 1000) { + batches.push(modsAll.slice(i, i + 1000)); + } + batches.forEach(batch => { + $.post({ + url: "/api/missionInventoryUpdate.php?" + window.authz, + contentType: "text/plain", + data: JSON.stringify({ + RawUpgrades: batch.map(mod => ({ + ItemType: mod, + ItemCount: 21 // To fully upgrade certain arcanes + })) + }) + }).done(function () { + updateInventory(); + }); }); - }); + } }); }); }