Skip to content

Commit

Permalink
chore: fix a bug with negative distance filter passed to options (mic…
Browse files Browse the repository at this point in the history
  • Loading branch information
michalchudziak authored Apr 6, 2023
1 parent 4864b4b commit ac477e9
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,9 @@ private void checkLocationSettings(ReadableMap options, LocationCallback locatio
locationRequest.setFastestInterval(locationOptions.fastestInterval);
}
locationRequest.setExpirationDuration((long) locationOptions.maximumAge);
locationRequest.setSmallestDisplacement(locationOptions.distanceFilter);
if (locationOptions.distanceFilter >= 0) {
locationRequest.setSmallestDisplacement(locationOptions.distanceFilter);
}
locationRequest.setPriority(
locationOptions.highAccuracy ? LocationRequest.PRIORITY_HIGH_ACCURACY : LocationRequest.PRIORITY_LOW_POWER
);
Expand Down

0 comments on commit ac477e9

Please sign in to comment.