fix: prevent loadKernel from running twice
This commit is contained in:
parent
341e5ef128
commit
1329712573
|
@ -13,6 +13,8 @@ import { getStoredUserKey } from "./storage.js";
|
|||
import { readableStreamToBlob } from "binconv";
|
||||
import { addContextToErr } from "@lumeweb/libkernel";
|
||||
|
||||
let kernelLoadAttempt = false;
|
||||
|
||||
export function boot() {
|
||||
let userKey;
|
||||
|
||||
|
@ -37,6 +39,12 @@ export function boot() {
|
|||
}
|
||||
|
||||
export async function loadKernel() {
|
||||
if (kernelLoadAttempt) {
|
||||
return;
|
||||
}
|
||||
|
||||
kernelLoadAttempt = true;
|
||||
|
||||
try {
|
||||
maybeInitDefaultPortals();
|
||||
} catch (e) {
|
||||
|
|
Loading…
Reference in New Issue