fix: do not try to restore a newly created layer on reset (#2381)

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.
This commit is contained in:
Yohan Boniface 2024-12-18 11:45:27 +01:00 committed by GitHub
commit 7b59cf4afb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

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