From f83a666aa12010b94bd24f859975afbae905adc8 Mon Sep 17 00:00:00 2001 From: David Larlet Date: Fri, 19 May 2023 11:32:40 -0400 Subject: [PATCH] Do not display an alert if the map is not created Refs #713, otherwise that first message is displayed and then override by the map creation one. --- umap/static/umap/js/umap.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/umap/static/umap/js/umap.js b/umap/static/umap/js/umap.js index f7057e55..ef81cc23 100644 --- a/umap/static/umap/js/umap.js +++ b/umap/static/umap/js/umap.js @@ -704,7 +704,14 @@ L.U.Map.include({ this.options.zoom = this.getZoom() this.isDirty = true this._default_extent = false - this.ui.alert({ content: L._('The zoom and center have been set.'), level: 'info' }) + if (this.options.umap_id) { + // We do not want an extra message during the map creation + // to avoid the double notification/alert. + this.ui.alert({ + content: L._('The zoom and center have been set.'), + level: 'info', + }) + } }, updateTileLayers: function () {