mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 11:35:04 +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 promise = new Promise(r => resolve = r);
|
||||||
const onMessage = function(event) {
|
const onMessage = function(event) {
|
||||||
if (event.data.replyTo === body.id) {
|
if (event.data.replyTo === body.id) {
|
||||||
worker.removeEventListener("message", onMessage);
|
navigator.serviceWorker.removeEventListener("message", onMessage);
|
||||||
resolve(event.data.content);
|
resolve(event.data.content);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
worker.addEventListener("message", onMessage);
|
navigator.serviceWorker.addEventListener("message", onMessage);
|
||||||
worker.postMessage(body);
|
worker.postMessage(body);
|
||||||
return promise;
|
return promise;
|
||||||
}
|
}
|
||||||
|
@ -148,6 +148,6 @@ export async function main(container, paths, legacyExtras) {
|
|||||||
const view = new RootView(vm);
|
const view = new RootView(vm);
|
||||||
container.appendChild(view.mount());
|
container.appendChild(view.mount());
|
||||||
} catch(err) {
|
} 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