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