Skip to content

Commit

Permalink
fix: don't zoom when clicking itinerary
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-heppner-ibigroup committed Oct 28, 2024
1 parent 4c6b236 commit 05ab4f3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/components/app/responsive-webapp.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ class ResponsiveWebapp extends Component {
/* eslint-disable-next-line complexity */
componentDidUpdate(prevProps) {
const {
activeItinerary,
activeSearchId,
autoFly,
currentPosition,
Expand Down Expand Up @@ -86,6 +87,7 @@ class ResponsiveWebapp extends Component {
// updating, etc.
formChanged(prevProps.query, query)
}
console.log(activeItinerary)

// check if device position changed (typically only set once, on initial page load)
if (currentPosition !== prevProps.currentPosition) {
Expand All @@ -100,7 +102,11 @@ class ResponsiveWebapp extends Component {
setLocationToCurrent({ locationType: 'from' }, intl)
setMapCenter(map, pt)
}
} else if (mainPanelContent === null && autoFly !== false) {
} else if (
mainPanelContent === null &&
autoFly !== false &&
activeItinerary === null
) {
if (query.from && query.to) {
map?.fitBounds([query.from, query.to], {
duration: 600,
Expand Down

0 comments on commit 05ab4f3

Please sign in to comment.