]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/main.ts
Add ability to disable tracker
[github/Chocobozzz/PeerTube.git] / client / src / main.ts
index 061be17deec6ea3bc5441c57124481122c09e15f..86fdabba564dd4d40a490f2d508d9660234ccd9f 100644 (file)
@@ -6,15 +6,16 @@ import { environment } from './environments/environment'
 
 import { hmrBootstrap } from './hmr'
 import { getDevLocale, isOnDevLocale } from '@app/shared/i18n/i18n-utils'
+import { buildFileLocale } from '../../shared'
 
-let providers = []
+let providers: any[] = []
 if (environment.production) {
   enableProdMode()
 }
 
 // Template translation, should be in the bootstrap step
 if (isOnDevLocale()) {
-  const locale = getDevLocale()
+  const locale = buildFileLocale(getDevLocale())
   const translations = require(`raw-loader!./locale/target/angular_${locale}.xml`)
 
   providers = [
@@ -33,7 +34,7 @@ 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) {