From 45a0ec5d428c8985a241dd3d668a52677b597d94 Mon Sep 17 00:00:00 2001 From: Yohan Boniface Date: Fri, 13 Dec 2024 10:05:20 +0100 Subject: [PATCH] fix: add default saved message Now that we do not always do a save on the map itself, we may have no feedback message in case we only save layers. --- umap/static/umap/js/modules/umap.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/umap/static/umap/js/modules/umap.js b/umap/static/umap/js/modules/umap.js index 1dae4466..664d8ea0 100644 --- a/umap/static/umap/js/modules/umap.js +++ b/umap/static/umap/js/modules/umap.js @@ -643,6 +643,12 @@ export default class Umap extends ServerStored { // have changed, we'll be more subtil when we'll remove the // save action this.render(['name', 'user', 'permissions']) + if (!this._leafletMap.listens('saved')) { + // When we save only layers, we don't have the map feedback message + this._leafletMap.on('saved', () => { + Alert.success(translate('Map has been saved!')) + }) + } this.fire('saved') }