Skip to content

Commit

Permalink
fix(maps.route.js): avoid redirecting to next route if it is the same…
Browse files Browse the repository at this point in the history
… of the current one
  • Loading branch information
amoncaldas committed Jan 19, 2022
1 parent 08d0d2a commit e0dbe76
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/pages/maps/maps.route.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,10 @@ const mapRoutes = [
} else {
// Otherwise load the map in the default or previous location
let zoom = store.getters.appRouteData.options.zoom || appConfig.initialZoomLevel
let mapLocation = `${placePath}@${store.getters.mapCenter.lng},${store.getters.mapCenter.lat},${zoom}`
next(mapLocation)
let newMapLocation = `${placePath}@${store.getters.mapCenter.lng},${store.getters.mapCenter.lat},${zoom}`
if (newMapLocation !== from.path) {
next(newMapLocation)
}
}
}
},
Expand Down

0 comments on commit e0dbe76

Please sign in to comment.