From 41ec18a08d256ed24d98de9cd906e82bee4d64e4 Mon Sep 17 00:00:00 2001 From: Yohan Boniface Date: Fri, 27 Oct 2023 10:10:29 +0200 Subject: [PATCH] Fix variable declared globally by mistake This can have an impact in map listing, because dataToload will be shared. --- umap/static/umap/js/umap.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/umap/static/umap/js/umap.js b/umap/static/umap/js/umap.js index 4626c2d1..d5cd01e4 100644 --- a/umap/static/umap/js/umap.js +++ b/umap/static/umap/js/umap.js @@ -397,7 +397,11 @@ L.U.Map.include({ loadDatalayers: function (force) { force = force || L.Util.queryString('download') // In case we are in download mode, let's go strait to loading all data - let toload = (dataToload = total = this.datalayers_index.length) + const total = this.datalayers_index.length + // toload => datalayer metadata remaining to load (synchronous) + // dataToload => datalayer data remaining to load (asynchronous) + let toload = total, + dataToload = total let datalayer const loaded = () => { this.datalayersLoaded = true