aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/main.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-02-26 11:44:54 +0100
committerChocobozzz <me@florianbigard.com>2018-02-26 11:44:54 +0100
commitfed951557277a6f783c75909f4cbeb21c4159133 (patch)
treeba5d6b8141116b3d147add4d0b918a13a5aafa4f /client/src/main.ts
parent73c695919c6569bfb667c36fc5a6b9b862130a0d (diff)
downloadPeerTube-fed951557277a6f783c75909f4cbeb21c4159133.tar.gz
PeerTube-fed951557277a6f783c75909f4cbeb21c4159133.tar.zst
PeerTube-fed951557277a6f783c75909f4cbeb21c4159133.zip
Disable service worker
Diffstat (limited to 'client/src/main.ts')
-rw-r--r--client/src/main.ts15
1 files changed, 11 insertions, 4 deletions
diff --git a/client/src/main.ts b/client/src/main.ts
index 9686ba4b8..4b18d163c 100644
--- a/client/src/main.ts
+++ b/client/src/main.ts
@@ -13,11 +13,18 @@ if (environment.production) {
13const bootstrap = () => platformBrowserDynamic() 13const bootstrap = () => platformBrowserDynamic()
14 .bootstrapModule(AppModule) 14 .bootstrapModule(AppModule)
15 .then(bootstrapModule => { 15 .then(bootstrapModule => {
16 // TODO: Uncomment and remove unregistration when https://github.com/angular/angular/issues/21191 is fixed
16 // TODO: Remove when https://github.com/angular/angular-cli/issues/8779 is fixed? 17 // TODO: Remove when https://github.com/angular/angular-cli/issues/8779 is fixed?
17 if ('serviceWorker' in navigator && environment.production) { 18 // if ('serviceWorker' in navigator && environment.production) {
18 navigator.serviceWorker.register('/ngsw-worker.js') 19 // navigator.serviceWorker.register('/ngsw-worker.js')
19 .catch(err => console.error('Cannot register service worker.', err)) 20 // .catch(err => console.error('Cannot register service worker.', err))
20 } 21 // }
22
23 navigator.serviceWorker.getRegistrations().then(registrations => {
24 for (const registration of registrations) {
25 registration.unregister()
26 }
27 })
21 28
22 return bootstrapModule 29 return bootstrapModule
23 }) 30 })