mirror of
https://github.com/umap-project/umap.git
synced 2025-04-28 11:32:38 +02:00
fix: do not display "saved" message if some request failed (#2669)
This commit is contained in:
commit
41752bd0c6
2 changed files with 4 additions and 2 deletions
|
@ -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() {
|
||||
|
|
|
@ -695,7 +695,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
|
||||
|
|
Loading…
Reference in a new issue