summaryrefslogtreecommitdiff
path: root/src/web/app/common/scripts/check-for-update.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/web/app/common/scripts/check-for-update.ts')
-rw-r--r--src/web/app/common/scripts/check-for-update.ts24
1 files changed, 0 insertions, 24 deletions
diff --git a/src/web/app/common/scripts/check-for-update.ts b/src/web/app/common/scripts/check-for-update.ts
deleted file mode 100644
index 0b58c0a674..0000000000
--- a/src/web/app/common/scripts/check-for-update.ts
+++ /dev/null
@@ -1,24 +0,0 @@
-import MiOS from '../mios';
-
-declare const _VERSION_: string;
-
-export default async function(mios: MiOS) {
- const meta = await mios.getMeta();
-
- if (meta.version != _VERSION_) {
- localStorage.setItem('should-refresh', 'true');
-
- // Clear cache (serive worker)
- try {
- navigator.serviceWorker.controller.postMessage('clear');
-
- navigator.serviceWorker.getRegistrations().then(registrations => {
- registrations.forEach(registration => registration.unregister());
- });
- } catch (e) {
- console.error(e);
- }
-
- alert('%i18n:common.update-available%'.replace('{newer}', meta.version).replace('{current}', _VERSION_));
- }
-}