]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/main.ts
Fix dropdowns z-index
[github/Chocobozzz/PeerTube.git] / client / src / main.ts
index e1a69e4a4b55a5d86ba5bd3fdb77da19c51ed49a..2d1749c420256a02eabaad237149a89975eb9bce 100644 (file)
@@ -4,8 +4,6 @@ import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'
 import { AppModule } from './app/app.module'
 import { environment } from './environments/environment'
 
-import { hmrBootstrap } from './hmr'
-
 if (environment.production) {
   enableProdMode()
 }
@@ -20,13 +18,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
@@ -36,13 +34,4 @@ const bootstrap = () => platformBrowserDynamic()
     return null
   })
 
-if (environment.hmr) {
-  if (module[ 'hot' ]) {
-    hmrBootstrap(module, bootstrap)
-  } else {
-    console.error('HMR is not enabled for webpack-dev-server!')
-    console.log('Are you using the --hmr flag for ng serve?')
-  }
-} else {
-  bootstrap()
-}
+bootstrap()