From be52e7ca2f4788c9203bfc5b781f199c8b37fd79 Mon Sep 17 00:00:00 2001 From: Yohan Boniface Date: Fri, 21 Mar 2025 16:45:10 +0100 Subject: [PATCH] wip: remove not effective code Co-authored-by: David Larlet --- umap/static/umap/js/modules/data/layer.js | 6 +++--- umap/static/umap/js/modules/sync/updaters.js | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/umap/static/umap/js/modules/data/layer.js b/umap/static/umap/js/modules/data/layer.js index 97f1ec26..b5f31977 100644 --- a/umap/static/umap/js/modules/data/layer.js +++ b/umap/static/umap/js/modules/data/layer.js @@ -458,13 +458,13 @@ export class DataLayer extends ServerStored { .sort(Utils.naturalSort) } - addData(geojson, sync, batch = true) { + addData(geojson, sync) { try { // Do not fail if remote data is somehow invalid, // otherwise the layer becomes uneditable. - if (batch) this.sync.startBatch() + this.sync.startBatch() const features = this.makeFeatures(geojson, sync) - if (batch) this.sync.commitBatch() + this.sync.commitBatch() return features } catch (err) { console.debug('Error with DataLayer', this.id) diff --git a/umap/static/umap/js/modules/sync/updaters.js b/umap/static/umap/js/modules/sync/updaters.js index 34fb656c..7388168d 100644 --- a/umap/static/umap/js/modules/sync/updaters.js +++ b/umap/static/umap/js/modules/sync/updaters.js @@ -64,7 +64,9 @@ export class DataLayerUpdater extends BaseUpdater { } catch { const datalayer = this._umap.createDataLayer(value._umap_options || value, false) if (value.features) { - datalayer.addData(value, true, false) + // FIXME: this will create new stages in the undoStack, thus this will empty + // the redoStack + datalayer.addData(value) } } }