fix(webui): use optional chaining operator for maxLevelCap (#2904)
				
					
				
			For items that not in itemMap Reviewed-on: OpenWF/SpaceNinjaServer#2904 Reviewed-by: Sainan <63328889+sainan@users.noreply.github.com> Co-authored-by: AMelonInsideLemon <166175391+AMelonInsideLemon@users.noreply.github.com> Co-committed-by: AMelonInsideLemon <166175391+AMelonInsideLemon@users.noreply.github.com>
This commit is contained in:
		
							parent
							
								
									96a15e25df
								
							
						
					
					
						commit
						fb4c42490e
					
				@ -832,7 +832,7 @@ function updateInventory() {
 | 
			
		||||
                            const td = document.createElement("td");
 | 
			
		||||
                            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 (
 | 
			
		||||
                                category != "Suits" &&
 | 
			
		||||
                                category != "SpaceSuits" &&
 | 
			
		||||
@ -859,7 +859,7 @@ function updateInventory() {
 | 
			
		||||
                                }
 | 
			
		||||
                            }
 | 
			
		||||
                            if (
 | 
			
		||||
                                itemMap[item.ItemType].maxLevelCap > 30 &&
 | 
			
		||||
                                itemMap[item.ItemType]?.maxLevelCap > 30 &&
 | 
			
		||||
                                (item.Polarized ?? 0) < (itemMap[item.ItemType].maxLevelCap - 30) / 2
 | 
			
		||||
                            ) {
 | 
			
		||||
                                const a = document.createElement("a");
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user