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