fix: fix race condition when slideshow is in autostart mode

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…)
This commit is contained in:
Yohan Boniface 2024-07-12 15:16:42 +02:00
parent bf08536c30
commit a51cc8102f

View file

@ -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') {