diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2017-03-18 00:02:41 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2017-03-18 00:02:53 +0900 |
| commit | 5ad77e8a3a7d3771559b02ea5c3e445ff2983533 (patch) | |
| tree | d6fbaa72a612baadee18e24c9ebc7e6a1fa3eb54 /src/web/app/boot.js | |
| parent | 7.7.3 (diff) | |
| download | misskey-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.js | 20 |
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 |