From 7f65b1de576d236b828d3d177ecd1d9972a2974f Mon Sep 17 00:00:00 2001 From: Yohan Boniface Date: Wed, 30 Oct 2024 09:42:06 +0100 Subject: [PATCH] chore: listen for later _trySave status --- umap/static/umap/js/modules/data/layer.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/umap/static/umap/js/modules/data/layer.js b/umap/static/umap/js/modules/data/layer.js index 27650e4d..1602cf52 100644 --- a/umap/static/umap/js/modules/data/layer.js +++ b/umap/static/umap/js/modules/data/layer.js @@ -1066,12 +1066,14 @@ export class DataLayer extends ServerStored { ), async () => { // Save again this layer - await this._trySave(url, {}, formData) - this.isDirty = false + const status = await this._trySave(url, {}, formData) + if (status) { + this.isDirty = false - // Call the main save, in case something else needs to be saved - // as the conflict stopped the saving flow - await this.map.saveAll() + // Call the main save, in case something else needs to be saved + // as the conflict stopped the saving flow + await this.map.saveAll() + } } ) }