summaryrefslogtreecommitdiff
path: root/src/web/app/common/scripts
diff options
context:
space:
mode:
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_));
}
}