fix: newBootloaderQuery should return a ErrTuple

This commit is contained in:
Derrick Hammer 2023-09-11 07:10:42 -04:00
parent 2369ab7d32
commit 3ee446a9c5
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 2 additions and 6 deletions

View File

@ -676,12 +676,8 @@ function newKernelQuery(
return [sendUpdate, p];
}
function newBootloaderQuery(method: string, data: any): Promise<any> {
function newBootloaderQuery(method: string, data: any): Promise<ErrTuple> {
return new Promise((resolve) => {
let receiveResponse = function (data: any) {
resolve(data.data);
};
initDefer.promise.then(() => {
if (getKernelIframe().contentWindow === null) {
console.error(
@ -690,7 +686,7 @@ function newBootloaderQuery(method: string, data: any): Promise<any> {
return;
}
let nonce = nextNonce();
queries[nonce] = { resolve: receiveResponse };
queries[nonce] = { resolve };
getKernelIframe().contentWindow?.postMessage(
{ method, data, nonce },
kernelOrigin,