From a51cc8102ffba0e19f9d80ff3a49e134f8adfa6e Mon Sep 17 00:00:00 2001 From: Yohan Boniface Date: Fri, 12 Jul 2024 15:16:42 +0200 Subject: [PATCH] fix: fix race condition when slideshow is in autostart mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Given `setViewFromQueryString` is now async, the slideshow may start before it is run and thus it has called `initCaptionBar`, so let's call it directly (and it's not linked to query string, so…) --- umap/static/umap/js/umap.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/umap/static/umap/js/umap.js b/umap/static/umap/js/umap.js index 5a8d0af4..e64789ca 100644 --- a/umap/static/umap/js/umap.js +++ b/umap/static/umap/js/umap.js @@ -187,6 +187,7 @@ U.Map = L.Map.extend({ } this.initShortcuts() + if (!this.options.noControl) this.initCaptionBar() this.onceDataLoaded(this.setViewFromQueryString) window.onbeforeunload = () => (this.editEnabled && this.isDirty) || null @@ -303,7 +304,6 @@ U.Map = L.Map.extend({ setViewFromQueryString: async function () { if (this.options.noControl) return - this.initCaptionBar() if (L.Util.queryString('share')) { this.share.open() } else if (this.options.onLoadPanel === 'databrowser') {