summaryrefslogtreecommitdiff
path: root/src/web/app/common/scripts/check-for-update.ls
diff options
context:
space:
mode:
Diffstat (limited to 'src/web/app/common/scripts/check-for-update.ls')
-rw-r--r--src/web/app/common/scripts/check-for-update.ls9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/web/app/common/scripts/check-for-update.ls b/src/web/app/common/scripts/check-for-update.ls
new file mode 100644
index 0000000000..48e250a4c7
--- /dev/null
+++ b/src/web/app/common/scripts/check-for-update.ls
@@ -0,0 +1,9 @@
+module.exports = ->
+ fetch \/api:meta
+ .then (res) ~>
+ meta <~ res.json!.then
+ if meta.commit.hash != VERSION
+ if window.confirm '新しいMisskeyのバージョンがあります。更新しますか?\r\n(このメッセージが繰り返し表示される場合は、サーバーにデータがまだ届いていない可能性があるので、少し時間を置いてから再度お試しください)'
+ location.reload true
+ .catch ~>
+ # ignore