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 { readableStreamToBlob } from "binconv";
|
||||||
import { addContextToErr } from "@lumeweb/libkernel";
|
import { addContextToErr } from "@lumeweb/libkernel";
|
||||||
|
|
||||||
|
let kernelLoadAttempt = false;
|
||||||
|
|
||||||
export function boot() {
|
export function boot() {
|
||||||
let userKey;
|
let userKey;
|
||||||
|
|
||||||
|
@ -37,6 +39,12 @@ export function boot() {
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function loadKernel() {
|
export async function loadKernel() {
|
||||||
|
if (kernelLoadAttempt) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
kernelLoadAttempt = true;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
maybeInitDefaultPortals();
|
maybeInitDefaultPortals();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|
Loading…
Reference in New Issue