summaryrefslogtreecommitdiff
path: root/src/web/app/common/scripts
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2017-11-28 15:43:17 +0900
committersyuilo <syuilotan@yahoo.co.jp>2017-11-28 15:43:17 +0900
commit8ed4e5422b6f7711b20c4ac032affac06617c3fa (patch)
tree2a866b6770f6b725a0ef366c8043d1cfff0f0c21 /src/web/app/common/scripts
parent:v: (diff)
downloadsharkey-8ed4e5422b6f7711b20c4ac032affac06617c3fa.tar.gz
sharkey-8ed4e5422b6f7711b20c4ac032affac06617c3fa.tar.bz2
sharkey-8ed4e5422b6f7711b20c4ac032affac06617c3fa.zip
:v:
Diffstat (limited to 'src/web/app/common/scripts')
-rw-r--r--src/web/app/common/scripts/check-for-update.ts8
1 files changed, 8 insertions, 0 deletions
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_));
}
}