]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - client/src/main.ts
Merge remote-tracking branch 'weblate/develop' into develop
[github/Chocobozzz/PeerTube.git] / client / src / main.ts
CommitLineData
361dcebc 1import { enableProdMode } from '@angular/core'
b6827820 2import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'
63c4db6d 3
b6827820
C
4import { AppModule } from './app/app.module'
5import { environment } from './environments/environment'
63c4db6d
C
6
7if (environment.production) {
b6827820 8 enableProdMode()
63c4db6d
C
9}
10
77d07d69 11const bootstrap = () => platformBrowserDynamic()
361dcebc 12 .bootstrapModule(AppModule)
78967fca 13 .then(bootstrapModule => {
fed95155 14 // TODO: Uncomment and remove unregistration when https://github.com/angular/angular/issues/21191 is fixed
78967fca 15 // TODO: Remove when https://github.com/angular/angular-cli/issues/8779 is fixed?
fed95155
C
16 // if ('serviceWorker' in navigator && environment.production) {
17 // navigator.serviceWorker.register('/ngsw-worker.js')
18 // .catch(err => console.error('Cannot register service worker.', err))
19 // }
20
c7ca4c8b 21 if (navigator.serviceWorker && typeof navigator.serviceWorker.getRegistrations === 'function') {
73e09f27 22 navigator.serviceWorker.getRegistrations()
361dcebc
C
23 .then(registrations => {
24 for (const registration of registrations) {
25 registration.unregister()
26 }
27 })
73e09f27 28 }
78967fca
C
29
30 return bootstrapModule
31 })
32 .catch(err => {
33 console.error(err)
34 return null
35 })
77d07d69 36
4f926722 37bootstrap()