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.
This commit is contained in:
parent
884ae0e218
commit
d44adcb7a9
3 changed files with 21 additions and 2 deletions
|
@ -65,4 +65,12 @@ export default class BasePlatform {
|
||||||
|
|
||||||
displayNotification(title: string, msg: string, avatarUrl: string) {
|
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();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -167,7 +167,6 @@ export default React.createClass({
|
||||||
case PageTypes.UserSettings:
|
case PageTypes.UserSettings:
|
||||||
page_element = <UserSettings
|
page_element = <UserSettings
|
||||||
onClose={this.props.onUserSettingsClose}
|
onClose={this.props.onUserSettingsClose}
|
||||||
version={this.props.version}
|
|
||||||
brand={this.props.config.brand}
|
brand={this.props.config.brand}
|
||||||
collapsedRhs={this.props.collapse_rhs}
|
collapsedRhs={this.props.collapse_rhs}
|
||||||
enableLabs={this.props.config.enableLabs}
|
enableLabs={this.props.config.enableLabs}
|
||||||
|
|
|
@ -17,6 +17,7 @@ var React = require('react');
|
||||||
var ReactDOM = require('react-dom');
|
var ReactDOM = require('react-dom');
|
||||||
var sdk = require('../../index');
|
var sdk = require('../../index');
|
||||||
var MatrixClientPeg = require("../../MatrixClientPeg");
|
var MatrixClientPeg = require("../../MatrixClientPeg");
|
||||||
|
var PlatformPeg = require("../../PlatformPeg");
|
||||||
var Modal = require('../../Modal');
|
var Modal = require('../../Modal');
|
||||||
var dis = require("../../dispatcher");
|
var dis = require("../../dispatcher");
|
||||||
var q = require('q');
|
var q = require('q');
|
||||||
|
@ -60,10 +61,21 @@ module.exports = React.createClass({
|
||||||
threePids: [],
|
threePids: [],
|
||||||
phase: "UserSettings.LOADING", // LOADING, DISPLAY
|
phase: "UserSettings.LOADING", // LOADING, DISPLAY
|
||||||
email_add_pending: false,
|
email_add_pending: false,
|
||||||
|
vectorVersion: null,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
componentWillMount: function() {
|
componentWillMount: function() {
|
||||||
|
if (PlatformPeg.get()) {
|
||||||
|
PlatformPeg.get().getAppVersion().done((appVersion) => {
|
||||||
|
this.setState({
|
||||||
|
vectorVersion: appVersion,
|
||||||
|
});
|
||||||
|
}, (e) => {
|
||||||
|
console.log("Failed to fetch app version", e);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
dis.dispatch({
|
dis.dispatch({
|
||||||
action: 'ui_opacity',
|
action: 'ui_opacity',
|
||||||
sideOpacity: 0.3,
|
sideOpacity: 0.3,
|
||||||
|
@ -587,7 +599,7 @@ module.exports = React.createClass({
|
||||||
</div>
|
</div>
|
||||||
<div className="mx_UserSettings_advanced">
|
<div className="mx_UserSettings_advanced">
|
||||||
matrix-react-sdk version: {REACT_SDK_VERSION}<br/>
|
matrix-react-sdk version: {REACT_SDK_VERSION}<br/>
|
||||||
vector-web version: {this.props.version}<br/>
|
vector-web version: {this.state.vectorVersion !== null ? this.state.vectorVersion : 'unknown'}<br/>
|
||||||
olm version: {olmVersionString}<br/>
|
olm version: {olmVersionString}<br/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue