From df8a2aea358ca3bcec60c878a6399df46390e3e1 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 24 Feb 2018 02:46:09 +0900 Subject: Implement #1098 --- src/web/app/common/scripts/check-for-update.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/web/app/common/scripts') diff --git a/src/web/app/common/scripts/check-for-update.ts b/src/web/app/common/scripts/check-for-update.ts index 0855676a42..fe539407da 100644 --- a/src/web/app/common/scripts/check-for-update.ts +++ b/src/web/app/common/scripts/check-for-update.ts @@ -9,7 +9,9 @@ export default async function(mios: MiOS) { // Clear cache (serive worker) try { - navigator.serviceWorker.controller.postMessage('clear'); + if (navigator.serviceWorker.controller) { + navigator.serviceWorker.controller.postMessage('clear'); + } navigator.serviceWorker.getRegistrations().then(registrations => { registrations.forEach(registration => registration.unregister()); -- cgit v1.2.3-freya