refactor: add getLoggedInDefer calls to kernelAuthStatus check

This commit is contained in:
Derrick Hammer 2023-07-19 05:24:19 -04:00
parent 2fd4a3be71
commit 56e0181c37
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 7 additions and 0 deletions

View File

@ -6,11 +6,13 @@ import {
getAuthStatusDefer, getAuthStatusDefer,
getAuthStatusKnown, getAuthStatusKnown,
getKernelIframe, getKernelIframe,
getLoggedInDefer,
getOpenPorts, getOpenPorts,
getQueries, getQueries,
getQueriesNonce, getQueriesNonce,
getQuery, getQuery,
increaseQueriesNonce, increaseQueriesNonce,
resetLoggedInDefer,
setAuthStatus, setAuthStatus,
setAuthStatusKnown, setAuthStatusKnown,
} from "../../vars.js"; } from "../../vars.js";
@ -49,6 +51,11 @@ export function handleKernelMessage(event: MessageEvent) {
console.log("bootloader is now initialized"); console.log("bootloader is now initialized");
if (!getAuthStatus().loginComplete) { if (!getAuthStatus().loginComplete) {
console.log("user is not logged in: waiting until login is confirmed"); console.log("user is not logged in: waiting until login is confirmed");
} else {
getLoggedInDefer().resolve();
}
if (getAuthStatus().logoutComplete) {
resetLoggedInDefer();
} }
} }