diff --git a/src/components/map/GeolocationMap.tsx b/src/components/map/GeolocationMap.tsx index 1dee2b50..4e2eaaa8 100644 --- a/src/components/map/GeolocationMap.tsx +++ b/src/components/map/GeolocationMap.tsx @@ -18,8 +18,6 @@ export default function GeoLocationMap({ onPermissionStatusChanged, zoom = 13, }: GeoLocationMapProps) { - const [status, setStatus] = useState('unknown'); - const mapContainerRef = useRef(null); const mapRef = useRef(null); @@ -82,7 +80,9 @@ export default function GeoLocationMap({ onPermissionStatusChanged(permissionStatus.state); } - geolocateControl.trigger(); + if (permissionStatus.state === 'granted') { + geolocateControl.trigger(); + } }; });