fix(web): correctly register notification service worker

This commit is contained in:
Jagandeep Brar
2022-09-08 00:51:05 -04:00
parent dcb59667c1
commit 579531c30a

View File

@@ -60,6 +60,8 @@
if ('serviceWorker' in navigator) {
// Service workers are supported. Use them.
window.addEventListener('load', function () {
navigator.serviceWorker.register('/firebase-messaging-sw.js');
// Wait for registration to finish before dropping the <script> tag.
// Otherwise, the browser will load the script multiple times,
// potentially different versions.