From ffdec1607635a150d3dafb0885d7b1caf3254dbb Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Thu, 18 Mar 2021 19:58:50 +0100 Subject: [PATCH] don't show the update dialog if we open the app for the first time and don't have a service worker yet --- src/platform/web/dom/ServiceWorkerHandler.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/platform/web/dom/ServiceWorkerHandler.js b/src/platform/web/dom/ServiceWorkerHandler.js index 668c7d64..f5bae8d0 100644 --- a/src/platform/web/dom/ServiceWorkerHandler.js +++ b/src/platform/web/dom/ServiceWorkerHandler.js @@ -42,7 +42,8 @@ export class ServiceWorkerHandler { this._currentController = navigator.serviceWorker.controller; this._registration.addEventListener("updatefound", this); this._registrationPromise = null; - if (this._registration.waiting) { + // do we have a new service worker waiting to activate? + if (this._registration.waiting && this._registration.active) { this._proposeUpdate(); } console.log("Service Worker registered");