summaryrefslogtreecommitdiff
path: root/src/web/app/common/scripts/check-for-update.js
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2017-03-18 20:05:11 +0900
committersyuilo <syuilotan@yahoo.co.jp>2017-03-18 20:05:11 +0900
commit45e8331e261244628b134a18e3d0fbe0ebb3a7dc (patch)
tree44ac1719fcea0a61c33698b23fb89400141e00d9 /src/web/app/common/scripts/check-for-update.js
parentBetter notification (diff)
downloadmisskey-45e8331e261244628b134a18e3d0fbe0ebb3a7dc.tar.gz
misskey-45e8331e261244628b134a18e3d0fbe0ebb3a7dc.tar.bz2
misskey-45e8331e261244628b134a18e3d0fbe0ebb3a7dc.zip
:sushi:
Closes #12, #227 and #58
Diffstat (limited to 'src/web/app/common/scripts/check-for-update.js')
-rw-r--r--src/web/app/common/scripts/check-for-update.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/web/app/common/scripts/check-for-update.js b/src/web/app/common/scripts/check-for-update.js
new file mode 100644
index 0000000000..637e6a9fb8
--- /dev/null
+++ b/src/web/app/common/scripts/check-for-update.js
@@ -0,0 +1,14 @@
+import CONFIG from './config';
+
+export default function() {
+ fetch(CONFIG.apiUrl + '/meta', {
+ method: 'POST'
+ }).then(res => {
+ res.json().then(meta => {
+ if (meta.version != VERSION) {
+ localStorage.setItem('should-refresh', 'true');
+ alert('Misskeyの新しいバージョンがあります。ページを再度読み込みすると更新が適用されます。');
+ }
+ });
+ });
+};