Skip to content

Commit

Permalink
fix(places-and-directions.js): direct flag of last place set to false…
Browse files Browse the repository at this point in the history
… after place removal
  • Loading branch information
amoncaldas committed Aug 2, 2021
1 parent 4eaa9a9 commit 21867d4
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -777,6 +777,11 @@ export default {
removePlaceInput (data, keepDirectionsMode = false) {
let placeInputsBeforeRemoval = this.places.length
this.places.splice(data.index, 1)

// If the last place has the direct flag, set it to false
if (this.places[data.index -1] && this.places[data.index -1].direct) {
this.places[data.index -1].direct = false
}
// Set the view mode constants.modes.directions or constants.modes.place
this.setViewMode()
this.updateAppRoute()
Expand Down

0 comments on commit 21867d4

Please sign in to comment.