Compare commits

...

2 commits

Author SHA1 Message Date
Yohan Boniface
488b5882e7 fixup: renaming 2024-10-30 09:43:31 +01:00
Yohan Boniface
7f65b1de57 chore: listen for later _trySave status 2024-10-30 09:42:06 +01:00
2 changed files with 10 additions and 8 deletions

View file

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

View file

@ -17,19 +17,19 @@ export class SaveManager {
add(obj) {
this._queue.add(obj)
this.checkStatus()
this.updateDOM()
}
delete(obj) {
this._queue.delete(obj)
this.checkStatus()
this.updateDOM()
}
has(obj) {
return this._queue.has(obj)
}
checkStatus() {
updateDOM() {
document.body.classList.toggle('umap-is-dirty', this._queue.size)
}
}