From e59bdcdfbc25a0148129faa094b4aa05604fe909 Mon Sep 17 00:00:00 2001 From: Sainan <63328889+Sainan@users.noreply.github.com> Date: Sat, 19 Apr 2025 09:05:43 -0700 Subject: [PATCH] chore(webui): assume deleting items will always succeed (#1731) instead of waiting for a response + then refreshing inventory, we can just delete the element right away and hope it works out Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/1731 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com> --- static/webui/script.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/static/webui/script.js b/static/webui/script.js index e8e4821e..f8fe085c 100644 --- a/static/webui/script.js +++ b/static/webui/script.js @@ -487,6 +487,7 @@ function updateInventory() { a.href = "#"; a.onclick = function (event) { event.preventDefault(); + document.getElementById(category + "-list").removeChild(tr); disposeOfGear(category, item.ItemId.$oid); }; a.title = loc("code_remove"); @@ -683,6 +684,7 @@ function updateInventory() { a.href = "#"; a.onclick = function (event) { event.preventDefault(); + document.getElementById("riven-list").removeChild(tr); disposeOfGear("Upgrades", item.ItemId.$oid); }; a.title = loc("code_remove"); @@ -723,6 +725,7 @@ function updateInventory() { a.href = "#"; a.onclick = function (event) { event.preventDefault(); + document.getElementById("mods-list").removeChild(tr); disposeOfGear("Upgrades", item.ItemId.$oid); }; a.title = loc("code_remove"); @@ -765,6 +768,7 @@ function updateInventory() { a.href = "#"; a.onclick = function (event) { event.preventDefault(); + document.getElementById("mods-list").removeChild(tr); disposeOfItems("Upgrades", item.ItemType, item.ItemCount); }; a.title = loc("code_remove"); @@ -1097,8 +1101,6 @@ function disposeOfGear(category, oid) { url: "/api/sell.php?" + window.authz, contentType: "text/plain", data: JSON.stringify(data) - }).done(function () { - updateInventory(); }); }); } @@ -1120,8 +1122,6 @@ function disposeOfItems(category, type, count) { url: "/api/sell.php?" + window.authz, contentType: "text/plain", data: JSON.stringify(data) - }).done(function () { - updateInventory(); }); }); }