From 45e8331e261244628b134a18e3d0fbe0ebb3a7dc Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 18 Mar 2017 20:05:11 +0900 Subject: :sushi: Closes #12, #227 and #58 --- src/web/app/common/scripts/check-for-update.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 src/web/app/common/scripts/check-for-update.js (limited to 'src/web/app/common/scripts/check-for-update.js') 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の新しいバージョンがあります。ページを再度読み込みすると更新が適用されます。'); + } + }); + }); +}; -- cgit v1.3.1-freya