chore: rename variable to make it more explicit

This commit is contained in:
Yohan Boniface 2025-04-09 11:27:04 +02:00
parent 5f2e104eec
commit 18f0b6e2a7
2 changed files with 6 additions and 7 deletions

View file

@ -146,14 +146,13 @@ class Feature {
} }
onCommit() { onCommit() {
this.pullGeometry(false)
// When the layer is a remote layer, we don't want to sync the creation of the // 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. // points via the websocket, as the other peers will get them themselves.
const oldGeoJSON = this._just_married ? null : Utils.CopyJSON(this.toGeoJSON())
this.pullGeometry(false)
if (this.datalayer?.isRemoteLayer()) return if (this.datalayer?.isRemoteLayer()) return
if (this._just_married) { if (this._needs_upsert) {
this.sync.upsert(this.toGeoJSON(), null) this.sync.upsert(this.toGeoJSON(), null)
this._just_married = false this._needs_upsert = false
} else { } else {
this.sync.update('geometry', this.geometry, this._geometry_bk) this.sync.update('geometry', this.geometry, this._geometry_bk)
} }

View file

@ -629,7 +629,7 @@ U.Editable = L.Editable.extend({
const line = new U.LineString(this._umap, datalayer, { const line = new U.LineString(this._umap, datalayer, {
geometry: { type: 'LineString', coordinates: [] }, geometry: { type: 'LineString', coordinates: [] },
}) })
line._just_married = true line._needs_upsert = true
return line.ui return line.ui
}, },
@ -638,7 +638,7 @@ U.Editable = L.Editable.extend({
const poly = new U.Polygon(this._umap, datalayer, { const poly = new U.Polygon(this._umap, datalayer, {
geometry: { type: 'Polygon', coordinates: [] }, geometry: { type: 'Polygon', coordinates: [] },
}) })
poly._just_married = true poly._needs_upsert = true
return poly.ui return poly.ui
}, },
@ -647,7 +647,7 @@ U.Editable = L.Editable.extend({
const point = new U.Point(this._umap, datalayer, { const point = new U.Point(this._umap, datalayer, {
geometry: { type: 'Point', coordinates: [latlng.lng, latlng.lat] }, geometry: { type: 'Point', coordinates: [latlng.lng, latlng.lat] },
}) })
point._just_married = true point._needs_upsert = true
return point.ui return point.ui
}, },