mirror of
https://github.com/umap-project/umap.git
synced 2025-04-28 19:42:36 +02:00
fix: do not display "saved" message if some request failed
This commit is contained in:
parent
05493d8a48
commit
4c71710641
2 changed files with 4 additions and 2 deletions
|
@ -225,13 +225,14 @@ export class SyncEngine {
|
||||||
}
|
}
|
||||||
for (const [obj, operations] of needSave.entries()) {
|
for (const [obj, operations] of needSave.entries()) {
|
||||||
const ok = await obj.save()
|
const ok = await obj.save()
|
||||||
if (!ok) break
|
if (!ok) return false
|
||||||
for (const operation of operations) {
|
for (const operation of operations) {
|
||||||
operation.dirty = false
|
operation.dirty = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.saved()
|
this.saved()
|
||||||
this._undoManager.toggleState()
|
this._undoManager.toggleState()
|
||||||
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
saved() {
|
saved() {
|
||||||
|
|
|
@ -691,7 +691,8 @@ export default class Umap {
|
||||||
if (!this.isDirty) return
|
if (!this.isDirty) return
|
||||||
if (this._defaultExtent) this._setCenterAndZoom()
|
if (this._defaultExtent) this._setCenterAndZoom()
|
||||||
this.backup()
|
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
|
// 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
|
// have changed, we'll be more subtil when we'll remove the
|
||||||
// save action
|
// save action
|
||||||
|
|
Loading…
Reference in a new issue