Simplify conditional and fix color calculation

This commit is contained in:
Maximilian Harz 2025-02-06 11:43:53 +01:00
parent 7e326590bb
commit a949df25c2
2 changed files with 4 additions and 5 deletions

View File

@ -210,12 +210,12 @@ export const Layer = ({
let color2 = markerDefaultColor2
if (item.color) {
color1 = item.color
} else if (itemTags && itemTags[0]) {
} else if (itemTags[0]) {
color1 = itemTags[0].color
}
// What is happening here?? Why do we depend on itemColorField?
if (itemTags && itemTags[0] && item.layer?.hasColor) color2 = itemTags[0].color
else if (itemTags && itemTags[1]) {
if (itemTags[0] && item.color) {
color2 = itemTags[0].color
} else if (itemTags[1]) {
color2 = itemTags[1].color
}
return (

View File

@ -18,7 +18,6 @@ export interface LayerProps {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
api?: ItemsApi<any>
itemType: ItemType
hasColor?: boolean
onlyOnePerOwner?: boolean
customEditLink?: string
customEditParameter?: string