Skip to content

Commit

Permalink
fix: be pickup locations disappearing after load (#38)
Browse files Browse the repository at this point in the history
- this was caused by the drag functionality which was triggered on load
- drag is now disabled based on country rather than platform
  • Loading branch information
EdieLemoine committed Feb 17, 2021
1 parent 941e2be commit b25fc64
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions src/delivery-options/components/Pickup/Map/Leaflet.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ import * as CONFIG from '@/data/keys/configKeys';
import * as EVENTS from '@/config/eventConfig';
import * as FORM from '@/config/formConfig';
import Modal from '@/delivery-options/components/Modal';
import { NL } from '@/config/localeConfig.js';
import PickupDetails from '@/delivery-options/components/Pickup/PickupDetails';
import { SENDMYPARCEL } from '@/data/keys/platformKeys';
import Vue from 'vue';
import { createIcons } from '@/delivery-options/components/Pickup/Map/createIcons';
import { createPickupChoices } from '@/delivery-options/data/pickup/createPickupChoices';
Expand Down Expand Up @@ -130,15 +130,14 @@ export default {
computed: {
/**
* TODO: Disallows dragging for BE.
* When we can look up pickup points using coordinates for bpost and dpd this can be removed.
* TODO: Disallows dragging for non-NL countries.
* When we can look up pickup points using coordinates everywhere this can be removed.
* Research: https://jira.dmp.zone/browse/MY-16566.
*
*
* @returns {Boolean}
*/
canUseDragFeature() {
return this.$configBus.get(CONFIG.PLATFORM) !== SENDMYPARCEL;
return NL === this.$configBus.address.cc;
},
mapClass() {
Expand Down Expand Up @@ -345,13 +344,6 @@ export default {
this.map.fitBounds(bounds);
this.map.setZoom(this.zoom);
const listener = () => {
this.onZoomEnd();
this.map.off('moveend', listener);
};
this.map.on('moveend', listener);
},
addMapEvents() {
Expand Down

0 comments on commit b25fc64

Please sign in to comment.