fix(webui): use optional chaining operator for maxLevelCap #2904

Merged
Sainan merged 1 commits from AMelonInsideLemon/SpaceNinjaServer:webui-fix-maxLevelCap into main 2025-10-17 22:37:46 -07:00

View File

@ -832,7 +832,7 @@ function updateInventory() {
const td = document.createElement("td"); const td = document.createElement("td");
td.classList = "text-end text-nowrap"; td.classList = "text-end text-nowrap";
let maxXP = Math.pow(itemMap[item.ItemType].maxLevelCap ?? 30, 2) * 1000; let maxXP = Math.pow(itemMap[item.ItemType]?.maxLevelCap ?? 30, 2) * 1000;
if ( if (
category != "Suits" && category != "Suits" &&
category != "SpaceSuits" && category != "SpaceSuits" &&
@ -859,7 +859,7 @@ function updateInventory() {
} }
} }
if ( if (
itemMap[item.ItemType].maxLevelCap > 30 && itemMap[item.ItemType]?.maxLevelCap > 30 &&
(item.Polarized ?? 0) < (itemMap[item.ItemType].maxLevelCap - 30) / 2 (item.Polarized ?? 0) < (itemMap[item.ItemType].maxLevelCap - 30) / 2
) { ) {
const a = document.createElement("a"); const a = document.createElement("a");