Skip to content

Commit

Permalink
refactor(map-view): remove unused canAddStop
Browse files Browse the repository at this point in the history
- add condition to map-right-click.js instead
  • Loading branch information
TheGreatRefrigerator committed Aug 26, 2024
1 parent 451603c commit 23a6e8a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export default {
},
computed: {
canAddStop () {
return this.$store.getters.mode === constants.modes.directions && this.mapViewData.hasRoutes()
return this.$store.getters.mode === constants.modes.directions && this.mapViewData.hasRoutes() && this.mapViewData.places.length < appConfig.maxPlaceInputs
},
show () {
return this.showRightClickPopup
Expand Down
9 changes: 1 addition & 8 deletions src/fragments/map-view/map-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -448,13 +448,6 @@ export default {
return markerData
}
},
/**
* Determines if a route stop can be added
*/
canAddStop () {
const can = !Array.isArray(this.markers) || this.markers.length < appConfig.maxPlaceInputs
return can
},
/**
* Return the current map polyline measures options
* @returns {Object} options
Expand Down Expand Up @@ -1367,7 +1360,7 @@ export default {
if (!insidePolygon) {
const mapEl = this.$refs.map.$el
GeoUtils.normalizeCoordinates(event.latlng)
const data = { event, mapEl, canAddStop: this.canAddStop }
const data = { event, mapEl }
// Event to be caught by the MapRightClick.vue component
EventBus.$emit('mapRightClicked', data)
}
Expand Down

0 comments on commit 23a6e8a

Please sign in to comment.