fix: newBootloaderQuery should return a ErrTuple
This commit is contained in:
parent
2369ab7d32
commit
3ee446a9c5
|
@ -676,12 +676,8 @@ function newKernelQuery(
|
||||||
return [sendUpdate, p];
|
return [sendUpdate, p];
|
||||||
}
|
}
|
||||||
|
|
||||||
function newBootloaderQuery(method: string, data: any): Promise<any> {
|
function newBootloaderQuery(method: string, data: any): Promise<ErrTuple> {
|
||||||
return new Promise((resolve) => {
|
return new Promise((resolve) => {
|
||||||
let receiveResponse = function (data: any) {
|
|
||||||
resolve(data.data);
|
|
||||||
};
|
|
||||||
|
|
||||||
initDefer.promise.then(() => {
|
initDefer.promise.then(() => {
|
||||||
if (getKernelIframe().contentWindow === null) {
|
if (getKernelIframe().contentWindow === null) {
|
||||||
console.error(
|
console.error(
|
||||||
|
@ -690,7 +686,7 @@ function newBootloaderQuery(method: string, data: any): Promise<any> {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let nonce = nextNonce();
|
let nonce = nextNonce();
|
||||||
queries[nonce] = { resolve: receiveResponse };
|
queries[nonce] = { resolve };
|
||||||
getKernelIframe().contentWindow?.postMessage(
|
getKernelIframe().contentWindow?.postMessage(
|
||||||
{ method, data, nonce },
|
{ method, data, nonce },
|
||||||
kernelOrigin,
|
kernelOrigin,
|
||||||
|
|
Loading…
Reference in New Issue