mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-22 19:14:52 +01:00
WIP working
This commit is contained in:
parent
3aa1992a3f
commit
ddf7d01760
@ -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;
|
||||
}
|
||||
|
@ -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`);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user