WIP working

This commit is contained in:
Bruno Windels 2020-10-15 21:35:10 +02:00
parent 3aa1992a3f
commit ddf7d01760
2 changed files with 3 additions and 3 deletions

View File

@ -37,11 +37,11 @@
const promise = new Promise(r => resolve = r);
const onMessage = function(event) {
if (event.data.replyTo === body.id) {
worker.removeEventListener("message", onMessage);
navigator.serviceWorker.removeEventListener("message", onMessage);
resolve(event.data.content);
}
}
worker.addEventListener("message", onMessage);
navigator.serviceWorker.addEventListener("message", onMessage);
worker.postMessage(body);
return promise;
}

View File

@ -148,6 +148,6 @@ export async function main(container, paths, legacyExtras) {
const view = new RootView(vm);
container.appendChild(view.mount());
} catch(err) {
console.error(`${err.message}:\n${err.stack}sdfdf`);
console.error(`${err.message}:\n${err.stack}dfdfdfdf`);
}
}