diff options
| author | Ariel Costas Guerrero <ariel@costas.dev> | 2026-03-16 14:13:26 +0100 |
|---|---|---|
| committer | Ariel Costas Guerrero <ariel@costas.dev> | 2026-03-16 14:13:35 +0100 |
| commit | ac626a9c2edc2e528eb0b39002c836a747b2fc16 (patch) | |
| tree | 981a9f8b02370f9a54459a8171cdd9a32aa11c15 /src/frontend/app/contexts | |
| parent | 8942cf3c705bbc78a6b3317599658e9bb86dd31b (diff) | |
feat: enhance geolocation handling with loading state and improve button click behavior
Diffstat (limited to 'src/frontend/app/contexts')
| -rw-r--r-- | src/frontend/app/contexts/MapContext.tsx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/frontend/app/contexts/MapContext.tsx b/src/frontend/app/contexts/MapContext.tsx index d93fefc..2c199be 100644 --- a/src/frontend/app/contexts/MapContext.tsx +++ b/src/frontend/app/contexts/MapContext.tsx @@ -72,6 +72,7 @@ export const MapProvider = ({ children }: { children: ReactNode }) => { const setLocationPermission = useCallback( (hasLocationPermission: boolean) => { setMapState((prev) => { + if (prev.hasLocationPermission === hasLocationPermission) return prev; const newState = { ...prev, hasLocationPermission }; localStorage.setItem("mapState", JSON.stringify(newState)); return newState; @@ -103,7 +104,6 @@ export const MapProvider = ({ children }: { children: ReactNode }) => { (position) => { const { latitude, longitude } = position.coords; setUserLocation([latitude, longitude]); - setLocationPermission(true); }, (error) => { if (error.code === GeolocationPositionError.PERMISSION_DENIED) { |
