Apply strictNullChecks to src/components/views/location/* (#10249
* strict fixes * accessiblebutton without onClick explicit * strict fix for UserMenu BaseAvatar
This commit is contained in:
parent
6de8d85f7e
commit
dd6fc124d7
12 changed files with 46 additions and 31 deletions
|
@ -33,9 +33,11 @@ const useMapMarker = (
|
|||
return;
|
||||
}
|
||||
const coords = parseGeoUri(geoUri);
|
||||
const newMarker = createMarker(coords, element);
|
||||
newMarker.addTo(map);
|
||||
setMarker(newMarker);
|
||||
if (coords) {
|
||||
const newMarker = createMarker(coords, element);
|
||||
newMarker.addTo(map);
|
||||
setMarker(newMarker);
|
||||
}
|
||||
},
|
||||
[marker, geoUri, map],
|
||||
);
|
||||
|
@ -43,7 +45,9 @@ const useMapMarker = (
|
|||
useEffect(() => {
|
||||
if (marker) {
|
||||
const coords = parseGeoUri(geoUri);
|
||||
marker.setLngLat({ lon: coords.longitude, lat: coords.latitude });
|
||||
if (coords) {
|
||||
marker.setLngLat({ lon: coords.longitude, lat: coords.latitude });
|
||||
}
|
||||
}
|
||||
}, [marker, geoUri]);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue