From aa2f3918cc5ef62ca21a6d18c9fae11eec4879da Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Wed, 30 Sep 2020 17:36:57 +0100 Subject: [PATCH] consolidate Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/vector/platform/WebPlatform.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/vector/platform/WebPlatform.ts b/src/vector/platform/WebPlatform.ts index 3f93ad712e..d91bb2593e 100644 --- a/src/vector/platform/WebPlatform.ts +++ b/src/vector/platform/WebPlatform.ts @@ -39,15 +39,12 @@ export default class WebPlatform extends VectorBasePlatform { // load service worker if available on this platform if ('serviceWorker' in navigator) { - // clean up old dummy sw.js - navigator.serviceWorker.getRegistration('sw.js').then(reg => reg.unregister()); - // Service worker is disabled in webpack-dev-server: https://github.com/GoogleChrome/workbox/issues/1790 if (!process.env.WEBPACK_DEV_SERVER) { navigator.serviceWorker.register('service-worker.js'); } else { // we no longer run workbox when in webpack-dev-server, clean it up - navigator.serviceWorker.getRegistration('service-worker.js').then(reg => reg.unregister()); + navigator.serviceWorker.getRegistration().then(reg => reg && reg.unregister()); } } }