refactor: remove old bootup code and use a refer to signal when we are booted
This commit is contained in:
parent
93dc1e76de
commit
73cf786750
|
@ -221,33 +221,5 @@ async function boot() {
|
||||||
document.body.appendChild(getKernelIframe());
|
document.body.appendChild(getKernelIframe());
|
||||||
});
|
});
|
||||||
|
|
||||||
await kernelLoaded();
|
weAreBooted();
|
||||||
await swarmClient.addRelay(
|
|
||||||
"fd35779a2dcae738308098e8f6702e25c282a52cce972ff2f96bcc50d5043c99"
|
|
||||||
);
|
|
||||||
await peerDiscoveryClient.register(
|
|
||||||
"_AEPtjxDCq3H4nmLLV7-P0L3D_d_Aude4i9O9S498dXcFw"
|
|
||||||
);
|
|
||||||
await ipfsClient.ready();
|
|
||||||
setupContextMenus(engine);
|
|
||||||
|
|
||||||
dnsSetup();
|
|
||||||
|
|
||||||
await getDnsSetupDefer().promise;
|
|
||||||
|
|
||||||
console.log("ready");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async function dnsSetup() {
|
|
||||||
const resolvers = [
|
|
||||||
"_B0tpRWWzAf77qfhiRMx1EGTDURht_2V9VsUmMqIzcpW4Q", // ens
|
|
||||||
// "vAMl33T1TusZqZmJl9mlWJCbYm_Lu1TPjE3aSl2ZFHE_yg", // hns
|
|
||||||
];
|
|
||||||
|
|
||||||
for (const resolver of resolvers) {
|
|
||||||
await dnsClient.registerResolver(resolver);
|
|
||||||
}
|
|
||||||
|
|
||||||
getDnsSetupDefer().resolve();
|
|
||||||
}
|
|
||||||
boot();
|
|
||||||
|
|
|
@ -19,6 +19,7 @@ let blockForBridge = new Promise((resolve) => {
|
||||||
});
|
});
|
||||||
let kernelFrame: HTMLIFrameElement;
|
let kernelFrame: HTMLIFrameElement;
|
||||||
let blockForDnsSetup = defer();
|
let blockForDnsSetup = defer();
|
||||||
|
let booted = defer();
|
||||||
|
|
||||||
export function getAuthStatusKnown() {
|
export function getAuthStatusKnown() {
|
||||||
return authStatusKnown;
|
return authStatusKnown;
|
||||||
|
@ -112,3 +113,11 @@ export function getBlockForBridge(): Promise<unknown> {
|
||||||
export function getBridgeLoadedResolve(): DataFn {
|
export function getBridgeLoadedResolve(): DataFn {
|
||||||
return bridgeLoadedResolve;
|
return bridgeLoadedResolve;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function getBooted(): Promise<unknown> {
|
||||||
|
return booted.promise;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function weAreBooted(): void {
|
||||||
|
booted.resolve();
|
||||||
|
}
|
||||||
|
|
Reference in New Issue