Skip to content

Commit

Permalink
fix: don't follow user when showing route on place search
Browse files Browse the repository at this point in the history
  • Loading branch information
afonsosousah committed Apr 26, 2024
1 parent 7fb88f4 commit 44ed3f9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions scripts/routing.js
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,9 @@ function getStationsByDistance(currentLocation) {
}

function showSearchBar() {
// Stop following user
followLocation = false;

// don't show another search bar if one is shown
if (document.getElementById("searchBarDiv")) return;

Expand Down Expand Up @@ -706,6 +709,9 @@ async function searchPlace() {
}

function hidePlaceSearchMenu() {
// Start following user again
followLocation = true;

// Hide search bar
let searchBar = document.getElementById("searchBarDiv");
if (searchBar) {
Expand Down

0 comments on commit 44ed3f9

Please sign in to comment.