diff --git a/src/BasePlatform.js b/src/BasePlatform.js index ff8fecf913..897a1a2dc8 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() { + throw new Error("getAppVersion not implemented!"); + } } 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 = { + return PlatformPeg.get().getAppVersion(); + }).done((appVersion) => { + if (this._unmounted) return; + this.setState({ + vectorVersion: appVersion, + }); + }, (e) => { + console.log("Failed to fetch app version", e); + }); + } + dis.dispatch({ action: 'ui_opacity', sideOpacity: 0.3, @@ -78,6 +94,7 @@ module.exports = React.createClass({ }, componentWillUnmount: function() { + this._unmounted = true; dis.dispatch({ action: 'ui_opacity', sideOpacity: 1.0, @@ -587,7 +604,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}