refactor: change how ready and logged in are controlled

This commit is contained in:
Derrick Hammer 2023-10-12 12:56:28 -04:00
parent 37a03e41ca
commit ea22848868
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 9 additions and 0 deletions

View File

@ -59,10 +59,17 @@ export function useBrowserState() {
} }
async function boot() { async function boot() {
const lume = useLume();
const reg = await navigator.serviceWorker.register("/sw.js"); const reg = await navigator.serviceWorker.register("/sw.js");
await reg.update(); await reg.update();
await kernel.serviceWorkerReady(); await kernel.serviceWorkerReady();
kernel.init().then(() => {
lume.setReady(true);
});
await kernelLoaded(); await kernelLoaded();
BOOT_FUNCTIONS.push( BOOT_FUNCTIONS.push(
@ -101,6 +108,8 @@ async function boot() {
await bootup(); await bootup();
lume.setIsLoggedIn(true);
await Promise.all([ await Promise.all([
ethClient.ready(), ethClient.ready(),
handshakeClient.ready(), handshakeClient.ready(),