diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2018-04-22 21:32:09 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2018-04-22 21:32:09 +0900 |
| commit | 0b99483ccbb1a4c111177718c0e9300a19d36a28 (patch) | |
| tree | 892645d59eb75cb69e5576df923825b3ceb7e20b /src | |
| parent | Fix bug (diff) | |
| download | sharkey-0b99483ccbb1a4c111177718c0e9300a19d36a28.tar.gz sharkey-0b99483ccbb1a4c111177718c0e9300a19d36a28.tar.bz2 sharkey-0b99483ccbb1a4c111177718c0e9300a19d36a28.zip | |
サーバーのバージョンとクライアントのバージョンを分けた
Diffstat (limited to 'src')
| -rw-r--r-- | src/client/app/boot.js | 4 | ||||
| -rw-r--r-- | src/client/app/common/scripts/check-for-update.ts | 2 | ||||
| -rw-r--r-- | src/server/api/endpoints/meta.ts | 9 | ||||
| -rw-r--r-- | src/version.ts | 7 |
4 files changed, 10 insertions, 12 deletions
diff --git a/src/client/app/boot.js b/src/client/app/boot.js index f5a1afec63..35d02cf9c5 100644 --- a/src/client/app/boot.js +++ b/src/client/app/boot.js @@ -105,8 +105,8 @@ const meta = await res.json(); // Compare versions - if (meta.version != ver) { - localStorage.setItem('v', meta.version); + if (meta.clientVersion != ver) { + localStorage.setItem('v', meta.clientVersion); alert( 'Misskeyの新しいバージョンがあります。ページを再度読み込みします。' + diff --git a/src/client/app/common/scripts/check-for-update.ts b/src/client/app/common/scripts/check-for-update.ts index 20ce64ea85..3ed9d41e76 100644 --- a/src/client/app/common/scripts/check-for-update.ts +++ b/src/client/app/common/scripts/check-for-update.ts @@ -3,7 +3,7 @@ import { version as current } from '../../config'; export default async function(mios: MiOS, force = false, silent = false) { const meta = await mios.getMeta(force); - const newer = meta.version; + const newer = meta.clientVersion; if (newer != current) { localStorage.setItem('should-refresh', 'true'); diff --git a/src/server/api/endpoints/meta.ts b/src/server/api/endpoints/meta.ts index f6a276a2b7..0e9ecf47df 100644 --- a/src/server/api/endpoints/meta.ts +++ b/src/server/api/endpoints/meta.ts @@ -2,10 +2,12 @@ * Module dependencies */ import * as os from 'os'; -import version from '../../../version'; import config from '../../../config'; import Meta from '../../../models/meta'; +const pkg = require('../../../../package.json'); +const client = require('../../../../built/client/meta.json'); + /** * @swagger * /meta: @@ -41,7 +43,10 @@ module.exports = (params) => new Promise(async (res, rej) => { res({ maintainer: config.maintainer, - version: version, + + version: pkg.version, + clientVersion: client.version, + secure: config.https != null, machine: os.hostname(), os: os.platform(), diff --git a/src/version.ts b/src/version.ts deleted file mode 100644 index d379b57f8f..0000000000 --- a/src/version.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** - * Version - */ - -const meta = require('../version.json'); - -export default meta.version as string; |