Skip to content

Commit c065d5d

Browse files
committed
fix: Missing fills info
1 parent 39521bc commit c065d5d

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/lib/utils/getIconPopup.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@ export function getIconPopup(vehicle: Vehicle) {
99
: vehicle.fills.filter(fill => !["DIESEL", "DEF", "AIR"].includes(fill.type));
1010

1111
if (fillData && fillData.length) { // Equipment has relevant fills
12-
if (fillData.some(fill => fill.type === "UNKNOWN")) { // Empty fill
12+
if (fillData.some(fill => fill.type === "UNKNOWN") && fillData.length === 1) { // Empty fill
1313
popupHTML += "<br>Empty";
1414
} else { // Valid & relevant fill data
15-
popupHTML += fillData.map(fill => {
15+
popupHTML += fillData.filter(fill => fill.type !== "UNKNOWN").map(fill => {
1616
return `<br><span style="text-transform: capitalize;">${fill.type.toLowerCase()}</span> (${fill.level.toLocaleString("en-US")})`;
1717
}).join("");
1818
}
1919
}
2020

21-
if (vehicle.controller) popupHTML += `<br>Player: ${vehicle.controller}`;
21+
if ("controller" in vehicle) popupHTML += `<br>Player: ${vehicle.controller}`;
2222

2323
popupHTML += "</small>";
2424

0 commit comments

Comments
 (0)