Skip to content

Commit 23a6e8a

Browse files
refactor(map-view): remove unused canAddStop
- add condition to map-right-click.js instead
1 parent 451603c commit 23a6e8a

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

src/fragments/map-view/components/map-right-click/map-right-click.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export default {
3030
},
3131
computed: {
3232
canAddStop () {
33-
return this.$store.getters.mode === constants.modes.directions && this.mapViewData.hasRoutes()
33+
return this.$store.getters.mode === constants.modes.directions && this.mapViewData.hasRoutes() && this.mapViewData.places.length < appConfig.maxPlaceInputs
3434
},
3535
show () {
3636
return this.showRightClickPopup

src/fragments/map-view/map-view.js

+1-8
Original file line numberDiff line numberDiff line change
@@ -448,13 +448,6 @@ export default {
448448
return markerData
449449
}
450450
},
451-
/**
452-
* Determines if a route stop can be added
453-
*/
454-
canAddStop () {
455-
const can = !Array.isArray(this.markers) || this.markers.length < appConfig.maxPlaceInputs
456-
return can
457-
},
458451
/**
459452
* Return the current map polyline measures options
460453
* @returns {Object} options
@@ -1367,7 +1360,7 @@ export default {
13671360
if (!insidePolygon) {
13681361
const mapEl = this.$refs.map.$el
13691362
GeoUtils.normalizeCoordinates(event.latlng)
1370-
const data = { event, mapEl, canAddStop: this.canAddStop }
1363+
const data = { event, mapEl }
13711364
// Event to be caught by the MapRightClick.vue component
13721365
EventBus.$emit('mapRightClicked', data)
13731366
}

0 commit comments

Comments
 (0)