diff --git a/umap/static/umap/js/modules/sync/engine.js b/umap/static/umap/js/modules/sync/engine.js index b6f0d151..f117b259 100644 --- a/umap/static/umap/js/modules/sync/engine.js +++ b/umap/static/umap/js/modules/sync/engine.js @@ -225,13 +225,14 @@ export class SyncEngine { } for (const [obj, operations] of needSave.entries()) { const ok = await obj.save() - if (!ok) break + if (!ok) return false for (const operation of operations) { operation.dirty = false } } this.saved() this._undoManager.toggleState() + return true } saved() { diff --git a/umap/static/umap/js/modules/umap.js b/umap/static/umap/js/modules/umap.js index 980ac1b8..7059c626 100644 --- a/umap/static/umap/js/modules/umap.js +++ b/umap/static/umap/js/modules/umap.js @@ -691,7 +691,8 @@ export default class Umap { if (!this.isDirty) return if (this._defaultExtent) this._setCenterAndZoom() this.backup() - await this.sync.save() + const status = await this.sync.save() + if (!status) return // Do a blind render for now, as we are not sure what could // have changed, we'll be more subtil when we'll remove the // save action