summaryrefslogtreecommitdiff
path: root/src/web/app/boot.js
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2017-03-18 00:02:41 +0900
committersyuilo <syuilotan@yahoo.co.jp>2017-03-18 00:02:53 +0900
commit5ad77e8a3a7d3771559b02ea5c3e445ff2983533 (patch)
treed6fbaa72a612baadee18e24c9ebc7e6a1fa3eb54 /src/web/app/boot.js
parent7.7.3 (diff)
downloadmisskey-5ad77e8a3a7d3771559b02ea5c3e445ff2983533.tar.gz
misskey-5ad77e8a3a7d3771559b02ea5c3e445ff2983533.tar.bz2
misskey-5ad77e8a3a7d3771559b02ea5c3e445ff2983533.zip
nanka iroiro
Diffstat (limited to 'src/web/app/boot.js')
-rw-r--r--src/web/app/boot.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/web/app/boot.js b/src/web/app/boot.js
index 6741a44231..4d008ad66f 100644
--- a/src/web/app/boot.js
+++ b/src/web/app/boot.js
@@ -49,6 +49,26 @@ try {
Storage.prototype.setItem = () => { }; // noop
}
+// クライアントを更新すべきならする
+if (localStorage.getItem('should-refresh') == 'true') {
+ localStorage.removeItem('should-refresh');
+ location.reload(true);
+}
+
+// 更新チェック
+setTimeout(() => {
+ fetch(CONFIG.apiUrl + '/meta', {
+ method: 'POST'
+ }).then(res => {
+ res.json().then(meta => {
+ if (meta.version != VERSION) {
+ localStorage.setItem('should-refresh', 'true');
+ alert('Misskeyの新しいバージョンがあります。ページを再度読み込みすると更新が適用されます。');
+ }
+ });
+ });
+}, 3000);
+
// ユーザーをフェッチしてコールバックする
module.exports = callback => {
// Get cached account data