diff --git a/bin/em/variabletime/web/js/audio.js b/bin/em/variabletime/web/js/audio.js index 03fd88d..a4a079e 100644 --- a/bin/em/variabletime/web/js/audio.js +++ b/bin/em/variabletime/web/js/audio.js @@ -807,7 +807,11 @@ const Audio = function(tp, record) { addAudioButton(layer, propTitle, isActive); } }); - return props.length > 1 && props[0] !== 'dummy'; + const good = props.length > 1 && props[0] !== 'dummy'; + if (good) { + this.injectedPanelAtLeastOnce = true; + } + return good; }; const audioSourceCombos = {}; const readAudioFiles = () => { diff --git a/bin/em/variabletime/web/js/main.js b/bin/em/variabletime/web/js/main.js index b27164c..4c31f84 100644 --- a/bin/em/variabletime/web/js/main.js +++ b/bin/em/variabletime/web/js/main.js @@ -330,12 +330,16 @@ const setLoadingDoneHook = () => { if (!addedListener) { const panel = tp.getPanel(); if (panel !== null) { - addedListener = true; - const injectedAll = () => { + if (audio.injectedPanelAtLeastOnce) { window.setLoadingDone(); - tp.getPanel().removeEventListener('injectedAll', injectedAll); - }; - tp.getPanel().addEventListener('injectedAll', injectedAll); + } else { + addedListener = true; + const injectedAll = () => { + window.setLoadingDone(); + tp.getPanel().removeEventListener('injectedAll', injectedAll); + }; + tp.getPanel().addEventListener('injectedAll', injectedAll); + } clearInterval(loadingInjectInterval); } }