diff --git a/mashlib.js b/mashlib.js index bf18aff..2470f00 100644 --- a/mashlib.js +++ b/mashlib.js @@ -20,6 +20,10 @@ document.head.appendChild(cssLink) // Inject xlogin for Solid/Nostr authentication var xloginScript = document.createElement('script') xloginScript.src = 'https://unpkg.com/xlogin' +var xloginLoaded = new Promise(r => { + xloginScript.addEventListener('load', r, { once: true }) + xloginScript.addEventListener('error', r, { once: true }) +}) document.head.appendChild(xloginScript) // Fetch the current resource @@ -81,5 +85,8 @@ for (var p of panes) { document.head.appendChild(el) } +await xloginLoaded +if (window.xlogin && window.xlogin.ready) await window.xlogin.ready + // Import shell — auto-boots on detecting
await import(base + 'losos/shell.js')