Decoding code fixes

This commit is contained in:
barsdeveloper
2024-07-16 21:36:13 +02:00
parent 98ebdd78b2
commit e0d8990e6a
18 changed files with 722 additions and 683 deletions

View File

@@ -54,15 +54,15 @@ const pinColorMaterial = css`120, 120, 120`
/** @param {PinEntity} entity */
export default function pinColor(entity) {
if (entity.PinType.PinCategory == "mask") {
if (entity.PinType.PinCategory?.valueOf() == "mask") {
const result = colors[entity.PinType.PinSubCategory]
if (result) {
return result
}
} else if (entity.PinType.PinCategory == "optional") {
} else if (entity.PinType.PinCategory?.valueOf() == "optional") {
return pinColorMaterial
}
return colors[entity.getType()]
?? colors[entity.PinType.PinCategory.toLowerCase()]
?? colors[entity.PinType.PinCategory?.valueOf().toLowerCase()]
?? colors["default"]
}