From f7444c6c0b01a70e3ed064df274de14c164e987a Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 18 Feb 2017 16:57:16 +0900 Subject: [PATCH] :v: --- src/web/app/boot.js | 2 +- src/web/app/common/mixins.js | 2 +- src/web/app/common/scripts/check-for-update.js | 11 +++++++++++ src/web/app/common/scripts/check-for-update.ls | 9 --------- 4 files changed, 13 insertions(+), 11 deletions(-) create mode 100644 src/web/app/common/scripts/check-for-update.js delete mode 100644 src/web/app/common/scripts/check-for-update.ls diff --git a/src/web/app/boot.js b/src/web/app/boot.js index 75a7086d1..b98602d40 100644 --- a/src/web/app/boot.js +++ b/src/web/app/boot.js @@ -8,7 +8,7 @@ const api = require('./common/scripts/api'); const signout = require('./common/scripts/signout'); const generateDefaultUserdata = require('./common/scripts/generate-default-userdata'); const mixins = require('./common/mixins'); -const checkForUpdate = require('./common/scripts/check-for-update.ls'); +const checkForUpdate = require('./common/scripts/check-for-update'); require('./common/tags'); /** diff --git a/src/web/app/common/mixins.js b/src/web/app/common/mixins.js index 208d0fdf5..220e03384 100644 --- a/src/web/app/common/mixins.js +++ b/src/web/app/common/mixins.js @@ -43,6 +43,6 @@ module.exports = me => { }); riot.mixin('ui-progress', { - Progress: require('./scripts/loading.ls') + Progress: require('./scripts/loading') }); }; 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 000000000..cd7279e3b --- /dev/null +++ b/src/web/app/common/scripts/check-for-update.js @@ -0,0 +1,11 @@ +module.exports = () => { + fetch('/api:meta').then(res => { + res.json().then(meta => { + if (meta.commit.hash !== VERSION) { + if (window.confirm('新しいMisskeyのバージョンがあります。更新しますか?\r\n(このメッセージが繰り返し表示される場合は、サーバーにデータがまだ届いていない可能性があるので、少し時間を置いてから再度お試しください)')) { + location.reload(true); + } + } + }); + }); +}; diff --git a/src/web/app/common/scripts/check-for-update.ls b/src/web/app/common/scripts/check-for-update.ls deleted file mode 100644 index 48e250a4c..000000000 --- a/src/web/app/common/scripts/check-for-update.ls +++ /dev/null @@ -1,9 +0,0 @@ -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