]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/main.ts
Store webtorrent chunks in indexdb
[github/Chocobozzz/PeerTube.git] / client / src / main.ts
index 4b18d163c446c09f13b4a485e93c1c1fd12f0e1f..e1a69e4a4b55a5d86ba5bd3fdb77da19c51ed49a 100644 (file)
@@ -20,11 +20,14 @@ const bootstrap = () => platformBrowserDynamic()
     //     .catch(err => console.error('Cannot register service worker.', err))
     // }
 
-    navigator.serviceWorker.getRegistrations().then(registrations => {
-      for (const registration of registrations) {
-        registration.unregister()
-      }
-    })
+    if (navigator.serviceWorker) {
+      navigator.serviceWorker.getRegistrations()
+        .then(registrations => {
+          for (const registration of registrations) {
+            registration.unregister()
+          }
+        })
+    }
 
     return bootstrapModule
   })