summaryrefslogtreecommitdiff
path: root/src/web/app/common/scripts/check-for-update.js
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2017-02-18 16:57:16 +0900
committersyuilo <syuilotan@yahoo.co.jp>2017-02-18 16:57:16 +0900
commitf7444c6c0b01a70e3ed064df274de14c164e987a (patch)
treee7019fc7e45e230c3d7102cb0ec27367aacf9ab3 /src/web/app/common/scripts/check-for-update.js
parent:v: (diff)
downloadmisskey-f7444c6c0b01a70e3ed064df274de14c164e987a.tar.gz
misskey-f7444c6c0b01a70e3ed064df274de14c164e987a.tar.bz2
misskey-f7444c6c0b01a70e3ed064df274de14c164e987a.zip
:v:
Diffstat (limited to 'src/web/app/common/scripts/check-for-update.js')
-rw-r--r--src/web/app/common/scripts/check-for-update.js11
1 files changed, 11 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..cd7279e3b8
--- /dev/null
+++ b/src/web/app/common/scripts/check-for-update.js
@@ -0,0 +1,11 @@
+module.exports = () => {
+ fetch('/api:meta').then(res => {
+ res.json().then(meta => {
+ if (meta.commit.hash !== VERSION) {
+ if (window.confirm('新しいMisskeyのバージョンがあります。更新しますか?\r\n(このメッセージが繰り返し表示される場合は、サーバーにデータがまだ届いていない可能性があるので、少し時間を置いてから再度お試しください)')) {
+ location.reload(true);
+ }
+ }
+ });
+ });
+};