Skip to content

Commit

Permalink
CM-1140: Fix for Current Location default init values (#1131)
Browse files Browse the repository at this point in the history
  • Loading branch information
molund authored Dec 12, 2023
1 parent d802b52 commit db826e2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/gatsby/src/pages/find-a-park.js
Original file line number Diff line number Diff line change
Expand Up @@ -453,8 +453,11 @@ export default function FindAPark({ location, data }) {
params.queryText = searchText;
}
if (selectedCity.length) {
params.near = `${selectedCity[0].latitude},${selectedCity[0].longitude}`;
params.radius = 100;
const city = selectedCity[0];
if (city.latitude !== 0 || city.longitude !== 0) {
params.near = `${city.latitude},${city.longitude}`;
params.radius = 100;
}
}
if (selectedAreas.length > 0) {
params.areas = selectedAreas.map(area => area.value)
Expand Down

0 comments on commit db826e2

Please sign in to comment.