Sharkey/src/web/app/common/scripts/check-for-update.js

15 lines
448 B
JavaScript
Raw Normal View History

2017-03-18 11:05:11 +00:00
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');
2017-03-25 12:14:38 +00:00
alert(`Misskeyの新しいバージョンがあります(${meta.version}。現在${VERSION}を利用中)。\nページを再度読み込みすると更新が適用されます。`);
2017-03-18 11:05:11 +00:00
}
});
});
};