summaryrefslogtreecommitdiff
path: root/src/web/app/common/scripts
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2018-03-03 07:32:18 +0900
committersyuilo <syuilotan@yahoo.co.jp>2018-03-03 07:32:18 +0900
commit6ba1035b69e8a3c4413d343b893ea6d9254e951f (patch)
tree310582e5dad44d50ddc3bc3c7cb1d6f9fdfafe51 /src/web/app/common/scripts
parent:v: (diff)
downloadsharkey-6ba1035b69e8a3c4413d343b893ea6d9254e951f.tar.gz
sharkey-6ba1035b69e8a3c4413d343b893ea6d9254e951f.tar.bz2
sharkey-6ba1035b69e8a3c4413d343b893ea6d9254e951f.zip
nanka iroiro
Closes #1168, #1169
Diffstat (limited to 'src/web/app/common/scripts')
-rw-r--r--src/web/app/common/scripts/check-for-update.ts10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/web/app/common/scripts/check-for-update.ts b/src/web/app/common/scripts/check-for-update.ts
index 3e7eb79d8b..81c1eb9812 100644
--- a/src/web/app/common/scripts/check-for-update.ts
+++ b/src/web/app/common/scripts/check-for-update.ts
@@ -1,11 +1,13 @@
import MiOS from '../mios';
-import { version } from '../../config';
+import { version as current } from '../../config';
export default async function(mios: MiOS, force = false, silent = false) {
const meta = await mios.getMeta(force);
+ const newer = meta.version;
- if (meta.version != version) {
+ if (newer != current) {
localStorage.setItem('should-refresh', 'true');
+ localStorage.setItem('v', newer);
// Clear cache (serive worker)
try {
@@ -21,10 +23,10 @@ export default async function(mios: MiOS, force = false, silent = false) {
}
if (!silent) {
- alert('%i18n:common.update-available%'.replace('{newer}', meta.version).replace('{current}', version));
+ alert('%i18n:common.update-available%'.replace('{newer}', newer).replace('{current}', current));
}
- return meta.version;
+ return newer;
} else {
return null;
}