From f6835baa9cbaf8c1f83f340ed87559393df18e70 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Fri, 17 Jun 2016 17:09:52 +0100 Subject: [PATCH] UserSettings: fix the displayed version of the react-sdk --- src/components/structures/UserSettings.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/components/structures/UserSettings.js b/src/components/structures/UserSettings.js index 60f9898e35..7fcb81a60c 100644 --- a/src/components/structures/UserSettings.js +++ b/src/components/structures/UserSettings.js @@ -20,7 +20,7 @@ var MatrixClientPeg = require("../../MatrixClientPeg"); var Modal = require('../../Modal'); var dis = require("../../dispatcher"); var q = require('q'); -var version = require('../../../package.json').version; +var package_json = require('../../../package.json'); var UserSettingsStore = require('../../UserSettingsStore'); var GeminiScrollbar = require('react-gemini-scrollbar'); var Email = require('../../email'); @@ -37,6 +37,11 @@ const LABS_FEATURES = [ } ]; +// if this looks like a release, use the 'version' from package.json; else use +// the git sha. +const REACT_SDK_VERSION = + 'dist' in package_json ? package_json.version : package_json.gitHead || ""; + module.exports = React.createClass({ displayName: 'UserSettings', @@ -57,7 +62,6 @@ module.exports = React.createClass({ return { avatarUrl: null, threePids: [], - clientVersion: version, phase: "UserSettings.LOADING", // LOADING, DISPLAY email_add_pending: false, }; @@ -465,7 +469,7 @@ module.exports = React.createClass({ Identity Server is { MatrixClientPeg.get().getIdentityServerUrl() }
- matrix-react-sdk version: {this.state.clientVersion}
+ matrix-react-sdk version: {REACT_SDK_VERSION}
vector-web version: {this.props.version}