]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame_incremental - client/src/main.ts
fix forgotten/reset password UI (#3351)
[github/Chocobozzz/PeerTube.git] / client / src / main.ts
... / ...
CommitLineData
1import { enableProdMode } from '@angular/core'
2import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'
3
4import { AppModule } from './app/app.module'
5import { environment } from './environments/environment'
6
7if (environment.production) {
8 enableProdMode()
9}
10
11const bootstrap = () => platformBrowserDynamic()
12 .bootstrapModule(AppModule)
13 .then(bootstrapModule => {
14 // TODO: Uncomment and remove unregistration when https://github.com/angular/angular/issues/21191 is fixed
15 // TODO: Remove when https://github.com/angular/angular-cli/issues/8779 is fixed?
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
21 if (navigator.serviceWorker && typeof navigator.serviceWorker.getRegistrations === 'function') {
22 navigator.serviceWorker.getRegistrations()
23 .then(registrations => {
24 for (const registration of registrations) {
25 registration.unregister()
26 }
27 })
28 }
29
30 return bootstrapModule
31 })
32 .catch(err => {
33 console.error(err)
34 return null
35 })
36
37bootstrap()