small fix

This commit is contained in:
Anton Tranelis 2024-04-23 22:08:57 +02:00
parent cc1a27e6ef
commit f1b338f36e
2 changed files with 2 additions and 5 deletions

View File

@ -16,7 +16,7 @@ export default function NavBar({ appName}: { appName: string }) {
const items = useItems();
useEffect(() => {
const profile = user && items.find(i => (i.user_created.id === user.id) && i.layer?.itemType.name === "user");
const profile = user && items.find(i => (i.user_created?.id === user.id) && i.layer?.itemType.name === "user");
profile ? setUserProfile(profile) : setUserProfile({id: crypto.randomUUID(), name: user?.first_name, text: ""});
}, [user, items])

View File

@ -176,11 +176,8 @@ export const Layer = ({
const longitude = itemLongitudeField && item ? getValue(item, itemLongitudeField) : undefined;
let color1 = markerDefaultColor;
let color2 = "RGBA(35, 31, 32, 0.2)";
console.log(getValue(item, itemColorField));
let color2 = "RGBA(35, 31, 32, 0.2)";
if (itemColorField && getValue(item, itemColorField) != null) color1 = getValue(item, itemColorField);
else if (itemTags && itemTags[0]) {
color1 = itemTags[0].color;
}