chore(sync): use sync=false everywhere to stop propagation

In some cases, you want to stop the propagation of events. The previous
code was using `fromSync=true` and `sync=false` interchangeably. This
makes it use `sync=false` everywhere.
This commit is contained in:
Alexis Métaireau 2024-05-15 18:54:56 +02:00
parent 0a1b2760de
commit 5c1c93f60e
No known key found for this signature in database
GPG key ID: 1C21B876828E5FF2
2 changed files with 3 additions and 5 deletions

View file

@ -122,6 +122,6 @@ export class FeatureUpdater extends BaseUpdater {
// XXX Distinguish between properties getting deleted // XXX Distinguish between properties getting deleted
// and the wole feature getting deleted // and the wole feature getting deleted
let feature = this.getFeatureFromMetadata(metadata) let feature = this.getFeatureFromMetadata(metadata)
if (feature) feature.del() if (feature) feature.del(false)
} }
} }

View file

@ -286,16 +286,14 @@ U.FeatureMixin = {
} }
return false return false
}, },
del: function (sync) {
del: function (fromSync) {
this.isDirty = true this.isDirty = true
this.map.closePopup() this.map.closePopup()
if (this.datalayer) { if (this.datalayer) {
this.datalayer.removeLayer(this) this.datalayer.removeLayer(this)
this.disconnectFromDataLayer(this.datalayer) this.disconnectFromDataLayer(this.datalayer)
// Do not relay the event if we received it. if (sync !== false) this.syncDelete()
if (!fromSync) this.syncDelete()
} }
}, },