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.ts12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/web/app/common/scripts/check-for-update.ts b/src/web/app/common/scripts/check-for-update.ts
index fe539407da..3e7eb79d8b 100644
--- a/src/web/app/common/scripts/check-for-update.ts
+++ b/src/web/app/common/scripts/check-for-update.ts
@@ -1,8 +1,8 @@
import MiOS from '../mios';
import { version } from '../../config';
-export default async function(mios: MiOS) {
- const meta = await mios.getMeta();
+export default async function(mios: MiOS, force = false, silent = false) {
+ const meta = await mios.getMeta(force);
if (meta.version != version) {
localStorage.setItem('should-refresh', 'true');
@@ -20,6 +20,12 @@ export default async function(mios: MiOS) {
console.error(e);
}
- alert('%i18n:common.update-available%'.replace('{newer}', meta.version).replace('{current}', version));
+ if (!silent) {
+ alert('%i18n:common.update-available%'.replace('{newer}', meta.version).replace('{current}', version));
+ }
+
+ return meta.version;
+ } else {
+ return null;
}
}