Better fix for #314

This commit is contained in:
the-djmaze 2022-04-16 02:38:57 +02:00
parent 20e391cf1c
commit 865f62dbb8

View file

@ -51,18 +51,10 @@ window.rl = {
loadScript(url) loadScript(url)
.then(() => loadScript(url.replace('/libs.', `/${admin?'admin':'app'}.`))) .then(() => loadScript(url.replace('/libs.', `/${admin?'admin':'app'}.`)))
.then(() => appData.PluginsLink ? loadScript(appData.PluginsLink) : Promise.resolve()) .then(() => appData.PluginsLink ? loadScript(appData.PluginsLink) : Promise.resolve())
.then(() => { .then(() => rl.app.bootstart
if ('complete' == doc.readyState) { ? cb()
cb(); : doc.addEventListener('readystatechange', () => 'complete' == doc.readyState && cb())
} else { )
let poll = setInterval(()=>{
if ('complete' == doc.readyState) {
clearInterval(poll);
cb();
}
}, 50);
}
})
.catch(e => { .catch(e => {
showError(e.message); showError(e.message);
throw e; throw e;