From cb727d433d9d1bc098e83a9723996a3362f7a169 Mon Sep 17 00:00:00 2001 From: Maximilian Harz Date: Mon, 10 Feb 2025 23:03:04 +0100 Subject: [PATCH] Fix paranthesis in ProfileForm --- src/Components/Profile/ProfileForm.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Components/Profile/ProfileForm.tsx b/src/Components/Profile/ProfileForm.tsx index 806d1a05..8b25baad 100644 --- a/src/Components/Profile/ProfileForm.tsx +++ b/src/Components/Profile/ProfileForm.tsx @@ -88,9 +88,10 @@ export function ProfileForm() { useEffect(() => { const newColor = - (item.color ?? (getItemTags(item) && getItemTags(item)[0]?.color)) + item.color ?? + (getItemTags(item) && getItemTags(item)[0]?.color ? getItemTags(item)[0].color - : item.layer?.markerDefaultColor + : item.layer?.markerDefaultColor) const offers = (item.offers ?? []).reduce((acc: Tag[], o) => { const offer = tags.find((t) => t.id === o.tags_id) @@ -195,7 +196,7 @@ export function ProfileForm() { type='submit' style={{ // We could refactor this, it is used several times at different locations - backgroundColor: `${(item.color ?? (getItemTags(item) && getItemTags(item)[0] && getItemTags(item)[0].color)) ? getItemTags(item)[0].color : item?.layer?.markerDefaultColor}`, + backgroundColor: `${item.color ?? (getItemTags(item) && getItemTags(item)[0] && getItemTags(item)[0].color ? getItemTags(item)[0].color : item?.layer?.markerDefaultColor)}`, color: '#fff', }} >