Skip to content

Commit

Permalink
fix: do not try to restore a newly created layer on reset (#2381)
Browse files Browse the repository at this point in the history
When asking for cancel, a layer that has not yet been saved to the
server should only be erased, no need to try to restore its previous
state.
  • Loading branch information
yohanboniface authored Dec 18, 2024
2 parents 32acdc2 + 1ead369 commit 7b59cf4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion umap/static/umap/js/modules/data/layer.js
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,10 @@ export class DataLayer extends ServerStored {
}

reset() {
if (!this.createdOnServer) this.erase()
if (!this.createdOnServer) {
this.erase()
return
}

this.resetOptions()
this.parentPane.appendChild(this.pane)
Expand Down

0 comments on commit 7b59cf4

Please sign in to comment.