diff --git a/src/main/background.ts b/src/main/background.ts index 7e287c1..a61cac9 100644 --- a/src/main/background.ts +++ b/src/main/background.ts @@ -221,33 +221,5 @@ async function boot() { document.body.appendChild(getKernelIframe()); }); - await kernelLoaded(); - await swarmClient.addRelay( - "fd35779a2dcae738308098e8f6702e25c282a52cce972ff2f96bcc50d5043c99" - ); - await peerDiscoveryClient.register( - "_AEPtjxDCq3H4nmLLV7-P0L3D_d_Aude4i9O9S498dXcFw" - ); - await ipfsClient.ready(); - setupContextMenus(engine); - - dnsSetup(); - - await getDnsSetupDefer().promise; - - console.log("ready"); + weAreBooted(); } - -async function dnsSetup() { - const resolvers = [ - "_B0tpRWWzAf77qfhiRMx1EGTDURht_2V9VsUmMqIzcpW4Q", // ens - // "vAMl33T1TusZqZmJl9mlWJCbYm_Lu1TPjE3aSl2ZFHE_yg", // hns - ]; - - for (const resolver of resolvers) { - await dnsClient.registerResolver(resolver); - } - - getDnsSetupDefer().resolve(); -} -boot(); diff --git a/src/main/vars.ts b/src/main/vars.ts index d026d40..7ab5c2f 100644 --- a/src/main/vars.ts +++ b/src/main/vars.ts @@ -19,6 +19,7 @@ let blockForBridge = new Promise((resolve) => { }); let kernelFrame: HTMLIFrameElement; let blockForDnsSetup = defer(); +let booted = defer(); export function getAuthStatusKnown() { return authStatusKnown; @@ -112,3 +113,11 @@ export function getBlockForBridge(): Promise { export function getBridgeLoadedResolve(): DataFn { return bridgeLoadedResolve; } + +export function getBooted(): Promise { + return booted.promise; +} + +export function weAreBooted(): void { + booted.resolve(); +}