feat(sync): Avoid syncing remote datalayers' features

They will be synced on their own, and we dont want them to be present
twice on the map.
This commit is contained in:
Alexis Métaireau 2024-05-09 17:41:55 +02:00
parent b99c242648
commit 9cb87392c0
2 changed files with 3 additions and 1 deletions

View file

@ -14,6 +14,9 @@ U.FeatureMixin = {
},
onCommit: function () {
// When the layer is a remote layer, we don't want to sync the creation of the
// points via the websocket, as the other peers will get them themselves.
if (this.datalayer.isRemoteLayer()) return
const { subject, metadata, engine } = this.getSyncMetadata()
engine.upsert(subject, metadata, this.toGeoJSON())
},

View file

@ -619,7 +619,6 @@ U.DataLayer = L.Evented.extend({
render: function (fields, builder) {
let impacts = U.Utils.getImpactsFromSchema(fields)
console.log('impacts', impacts)
for (let impact of impacts) {
switch (impact) {