fix: remove checking the method for kernel -> sw messages

This commit is contained in:
Derrick Hammer 2023-09-16 14:26:05 -04:00
parent 34da5bdd21
commit 6e1e244f0e
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 4 additions and 11 deletions

View File

@ -136,17 +136,10 @@ function handleMessage(event: MessageEvent) {
return; return;
} }
if (event.source === kernelIframe?.contentWindow) { if (event.source === kernelIframe?.contentWindow && event.data.sw) {
if ( delete event.data.sw;
["response", "queryUpdate", "responseNonce", "responseUpdate"].includes( serviceWorker?.postMessage(event.data);
event.data.method, return;
) &&
event.data.sw
) {
delete event.data.sw;
serviceWorker?.postMessage(event.data);
return;
}
} }
if (FROM_SW) { if (FROM_SW) {
if (["moduleCall", "queryUpdate", "response"].includes(event.data.method)) { if (["moduleCall", "queryUpdate", "response"].includes(event.data.method)) {