From 73e09f270660c78e50e86921a5ca6b356f760c7c Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 8 Mar 2018 12:01:55 +0100 Subject: Try to detect incompatible web browsers --- client/src/main.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'client/src/main.ts') diff --git a/client/src/main.ts b/client/src/main.ts index 4b18d163c..e1a69e4a4 100644 --- a/client/src/main.ts +++ b/client/src/main.ts @@ -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 }) -- cgit v1.2.3