From a2eebf92ff2aac04377ac46c550a909151e8efe2 Mon Sep 17 00:00:00 2001 From: Sebastian Leidig Date: Wed, 10 Jun 2020 09:50:16 +0200 Subject: [PATCH] fix(*): prevent error log message about serviceworker not available --- src/app/core/latest-changes/update-manager.service.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/app/core/latest-changes/update-manager.service.ts b/src/app/core/latest-changes/update-manager.service.ts index 8594f3fead..4acc0f3fcc 100644 --- a/src/app/core/latest-changes/update-manager.service.ts +++ b/src/app/core/latest-changes/update-manager.service.ts @@ -44,6 +44,10 @@ export class UpdateManagerService { * Display a notification to the user in case a new app version is detected by the ServiceWorker. */ public notifyUserWhenUpdateAvailable() { + if (!this.updates.isEnabled) { + return; + } + this.updates.available.subscribe(() => { this.showUpdateNotification(); }); @@ -53,6 +57,10 @@ export class UpdateManagerService { * Schedule a regular check with the server for updates. */ public regularlyCheckForUpdates() { + if (!this.updates.isEnabled) { + return; + } + // Allow the app to stabilize first, before starting polling for updates with `interval()`. const appIsStable$ = this.appRef.isStable.pipe( first((isStable) => isStable === true)