From 1ead36948797001958d93726b949661722b88cfd Mon Sep 17 00:00:00 2001 From: Yohan Boniface Date: Wed, 18 Dec 2024 11:21:36 +0100 Subject: [PATCH] fix: do not try to restore a newly created layer on reset 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. --- umap/static/umap/js/modules/data/layer.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/umap/static/umap/js/modules/data/layer.js b/umap/static/umap/js/modules/data/layer.js index dde942b46..734aaca14 100644 --- a/umap/static/umap/js/modules/data/layer.js +++ b/umap/static/umap/js/modules/data/layer.js @@ -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)