Display the version in UserSettings. Change MatrixChat.onNewVersion to onVersion

This commit is contained in:
Kegan Dougal 2016-02-03 16:51:53 +00:00
parent 7bdd9f57a5
commit 8b96af4ccb
2 changed files with 7 additions and 3 deletions

View file

@ -804,9 +804,10 @@ module.exports = React.createClass({
this.showScreen("settings"); this.showScreen("settings");
}, },
onNewVersion: function(current, latest) { onVersion: function(current, latest) {
this.setState({ this.setState({
hasNewVersion: true version: current,
hasNewVersion: current !== latest
}); });
}, },
@ -887,7 +888,7 @@ module.exports = React.createClass({
right_panel = <RightPanel roomId={this.state.currentRoom} collapsed={this.state.collapse_rhs} /> right_panel = <RightPanel roomId={this.state.currentRoom} collapsed={this.state.collapse_rhs} />
break; break;
case this.PageTypes.UserSettings: case this.PageTypes.UserSettings:
page_element = <UserSettings onClose={this.onUserSettingsClose} /> page_element = <UserSettings onClose={this.onUserSettingsClose} version={this.state.version} />
right_panel = <RightPanel collapsed={this.state.collapse_rhs}/> right_panel = <RightPanel collapsed={this.state.collapse_rhs}/>
break; break;
case this.PageTypes.CreateRoom: case this.PageTypes.CreateRoom:

View file

@ -30,6 +30,7 @@ module.exports = React.createClass({
displayName: 'UserSettings', displayName: 'UserSettings',
propTypes: { propTypes: {
version: React.PropTypes.string,
onClose: React.PropTypes.func onClose: React.PropTypes.func
}, },
@ -377,6 +378,8 @@ module.exports = React.createClass({
</div> </div>
<div className="mx_UserSettings_advanced"> <div className="mx_UserSettings_advanced">
Version {this.state.clientVersion} Version {this.state.clientVersion}
<br />
{this.props.version}
</div> </div>
</div> </div>