Skip to content

Commit

Permalink
fix: enable tracking only if passed explicitely
Browse files Browse the repository at this point in the history
  • Loading branch information
ahennr committed Jan 24, 2025
1 parent 86a9a64 commit e2d03ff
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/Button/GeoLocationButton/GeoLocationButton.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import React, {
FC
} from 'react';

import {
type GeoLocation,
useGeoLocation
} from '@terrestris/react-util/dist/Hooks/useGeoLocation/useGeoLocation';
import React, {
FC
} from 'react';

import { CSS_PREFIX } from '../../constants';
import ToggleButton, { ToggleButtonProps } from '../ToggleButton/ToggleButton';
Expand Down Expand Up @@ -50,7 +51,7 @@ export const GeoLocationButton: FC<GeoLocationButtonProps> = ({

useGeoLocation({
active: !!pressed,
enableTracking: pressed,
enableTracking: pressed && enableTracking,
follow,
onError,
onGeoLocationChange,
Expand Down

0 comments on commit e2d03ff

Please sign in to comment.