From d44adcb7a9c239a457fa0f0bfb094012b123ab63 Mon Sep 17 00:00:00 2001 From: David Baker Date: Tue, 8 Nov 2016 10:45:19 +0000 Subject: [PATCH] Fix the vector web version in UserSettings Add a getAppVersion() function to the platform rather than relying on the updater code firing an event before we know what the app version is. --- src/BasePlatform.js | 8 ++++++++ src/components/structures/LoggedInView.js | 1 - src/components/structures/UserSettings.js | 14 +++++++++++++- 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/src/BasePlatform.js b/src/BasePlatform.js index ff8fecf913..ffb32fce64 100644 --- a/src/BasePlatform.js +++ b/src/BasePlatform.js @@ -65,4 +65,12 @@ export default class BasePlatform { displayNotification(title: string, msg: string, avatarUrl: string) { } + + /** + * Returns a promise that resolves to a string representing + * the current version of the application. + */ + getAppVersion() { + return q(); + } } diff --git a/src/components/structures/LoggedInView.js b/src/components/structures/LoggedInView.js index e006f6ee3f..7c0fe14edd 100644 --- a/src/components/structures/LoggedInView.js +++ b/src/components/structures/LoggedInView.js @@ -167,7 +167,6 @@ export default React.createClass({ case PageTypes.UserSettings: page_element = { + this.setState({ + vectorVersion: appVersion, + }); + }, (e) => { + console.log("Failed to fetch app version", e); + }); + } + dis.dispatch({ action: 'ui_opacity', sideOpacity: 0.3, @@ -587,7 +599,7 @@ module.exports = React.createClass({
matrix-react-sdk version: {REACT_SDK_VERSION}
- vector-web version: {this.props.version}
+ vector-web version: {this.state.vectorVersion !== null ? this.state.vectorVersion : 'unknown'}
olm version: {olmVersionString}