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) } } }