X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fmain.ts;h=3fb9b346e29ec91272528f4f43ce108c9260b48e;hb=70d93192adbc54175c7759975c4ad843e6f7d417;hp=e1a69e4a4b55a5d86ba5bd3fdb77da19c51ed49a;hpb=73e09f270660c78e50e86921a5ca6b356f760c7c;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/main.ts b/client/src/main.ts index e1a69e4a4..3fb9b346e 100644 --- a/client/src/main.ts +++ b/client/src/main.ts @@ -20,13 +20,13 @@ const bootstrap = () => platformBrowserDynamic() // .catch(err => console.error('Cannot register service worker.', err)) // } - if (navigator.serviceWorker) { + if (navigator.serviceWorker && typeof navigator.serviceWorker.getRegistrations === 'function') { navigator.serviceWorker.getRegistrations() - .then(registrations => { - for (const registration of registrations) { - registration.unregister() - } - }) + .then(registrations => { + for (const registration of registrations) { + registration.unregister() + } + }) } return bootstrapModule