Move navigator message listener registration to be synchronously attached (#28340)

to silence Chrome warning

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Michael Telatynski 2024-11-05 11:04:14 +00:00 committed by GitHub
parent d7d96b6b8b
commit c9d9c421bc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -54,8 +54,8 @@ export default class WebPlatform extends VectorBasePlatform {
return;
}
await registration.update();
navigator.serviceWorker.addEventListener("message", this.onServiceWorkerPostMessage.bind(this));
await registration.update();
}
private onServiceWorkerPostMessage(event: MessageEvent): void {