mirror of
https://github.com/umap-project/umap.git
synced 2025-04-29 03:42:37 +02:00
Compare commits
2 commits
ed232e59b8
...
488b5882e7
Author | SHA1 | Date | |
---|---|---|---|
![]() |
488b5882e7 | ||
![]() |
7f65b1de57 |
2 changed files with 10 additions and 8 deletions
|
@ -1066,12 +1066,14 @@ export class DataLayer extends ServerStored {
|
||||||
),
|
),
|
||||||
async () => {
|
async () => {
|
||||||
// Save again this layer
|
// Save again this layer
|
||||||
await this._trySave(url, {}, formData)
|
const status = await this._trySave(url, {}, formData)
|
||||||
this.isDirty = false
|
if (status) {
|
||||||
|
this.isDirty = false
|
||||||
|
|
||||||
// Call the main save, in case something else needs to be saved
|
// Call the main save, in case something else needs to be saved
|
||||||
// as the conflict stopped the saving flow
|
// as the conflict stopped the saving flow
|
||||||
await this.map.saveAll()
|
await this.map.saveAll()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,19 +17,19 @@ export class SaveManager {
|
||||||
|
|
||||||
add(obj) {
|
add(obj) {
|
||||||
this._queue.add(obj)
|
this._queue.add(obj)
|
||||||
this.checkStatus()
|
this.updateDOM()
|
||||||
}
|
}
|
||||||
|
|
||||||
delete(obj) {
|
delete(obj) {
|
||||||
this._queue.delete(obj)
|
this._queue.delete(obj)
|
||||||
this.checkStatus()
|
this.updateDOM()
|
||||||
}
|
}
|
||||||
|
|
||||||
has(obj) {
|
has(obj) {
|
||||||
return this._queue.has(obj)
|
return this._queue.has(obj)
|
||||||
}
|
}
|
||||||
|
|
||||||
checkStatus() {
|
updateDOM() {
|
||||||
document.body.classList.toggle('umap-is-dirty', this._queue.size)
|
document.body.classList.toggle('umap-is-dirty', this._queue.size)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue