From 8ed4e5422b6f7711b20c4ac032affac06617c3fa Mon Sep 17 00:00:00 2001 From: syuilo Date: Tue, 28 Nov 2017 15:43:17 +0900 Subject: [PATCH] :v: --- src/web/app/common/scripts/check-for-update.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/web/app/common/scripts/check-for-update.ts b/src/web/app/common/scripts/check-for-update.ts index c447a517fa..1540924510 100644 --- a/src/web/app/common/scripts/check-for-update.ts +++ b/src/web/app/common/scripts/check-for-update.ts @@ -7,6 +7,14 @@ export default async function(mios: MiOS) { if (meta.version != _VERSION_) { localStorage.setItem('should-refresh', 'true'); + + // Clear cache (serive worker) + try { + navigator.serviceWorker.controller.postMessage('clear'); + } catch (e) { + console.error(e); + } + alert('%i18n:common.update-available%'.replace('{newer}', meta.version).replace('{current}', _VERSION_)); } }