From b287cc3aff3493a0ee9df7c99a7a09e1b967a69c Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Fri, 23 Jun 2023 19:35:26 -0400 Subject: [PATCH] refactor: set active portals based on bootloaderPortals --- src/index.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/index.ts b/src/index.ts index 99543e6..458ba27 100644 --- a/src/index.ts +++ b/src/index.ts @@ -11,6 +11,8 @@ import { logLargeObjects } from "./logLargeState.js"; import { log, logErr } from "./log.js"; import { handleModuleCall, handleQueryUpdate } from "./queries.js"; import { KERNEL_DISTRO, KERNEL_VERSION } from "./version.js"; +import { setActivePortals } from "@lumeweb/libweb"; +import { Client } from "@lumeweb/libportal"; // These three functions are expected to have already been declared by the // bootloader. They are necessary for getting started and downloading the @@ -19,6 +21,7 @@ import { KERNEL_DISTRO, KERNEL_VERSION } from "./version.js"; // The kernel is encouraged to overwrite these functions with new values. declare let handleIncomingMessage: (event: MessageEvent) => void; declare let handleSkynetKernelRequestOverride: (event: MessageEvent) => void; +declare let bootloaderPortals: Client[]; // IS_EXTENSION is a boolean that indicates whether or not the kernel is // running in a browser extension. @@ -31,6 +34,9 @@ logLargeObjects(); // Establish the stateful variable for tracking module overrides. let moduleOverrideList = {} as any; +// Set up portals based on the instances created in the bootloader +setActivePortals(bootloaderPortals); + // Write a log that declares the kernel version and distribution. log("init", "Lume Web Kernel v" + KERNEL_VERSION + "-" + KERNEL_DISTRO);