From b5d3ba46cf2f912652bf32769c6ae60dab40224a Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Mon, 11 Sep 2023 06:52:58 -0400 Subject: [PATCH] fix: replace kernelLoadedResolve with kernelLoadedDefer --- src/kernel/queries.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/kernel/queries.ts b/src/kernel/queries.ts index fc9f06e..b5246aa 100644 --- a/src/kernel/queries.ts +++ b/src/kernel/queries.ts @@ -229,9 +229,9 @@ function handleMessage(event: MessageEvent) { if (!kernelLoadedResolved && event.data.data.kernelLoaded !== "not yet") { kernelLoadedResolved = true; if (event.data.data.kernelLoaded === "success") { - kernelLoadedResolve(null); + kernelLoadedDefer.resolve(null); } else { - kernelLoadedResolve(event.data.data.kernelLoaded); + kernelLoadedDefer.resolve(event.data.data.kernelLoaded); } } @@ -414,7 +414,6 @@ let initDefer: DeferredPromise; let loginResolved = false; // set to true once we know the user is logged in let loginDefer: DeferredPromise; let kernelLoadedResolved = false; // set to true once the user kernel is loaded -let kernelLoadedResolve: (err: Err) => void; let kernelLoadedDefer: DeferredPromise; const logoutResolved = false; // set to true once the user is logged out let logoutDefer: DeferredPromise;