Merge pull request #532 from matrix-org/dbkr/platform_version
Move 'new version' support into Platform
This commit is contained in:
commit
31a47a9efd
1 changed files with 14 additions and 3 deletions
|
@ -105,6 +105,8 @@ module.exports = React.createClass({
|
|||
|
||||
version: null,
|
||||
newVersion: null,
|
||||
hasNewVersion: false,
|
||||
newVersionReleaseNotes: null,
|
||||
|
||||
// The username to default to when upgrading an account from a guest
|
||||
upgradeUsername: null,
|
||||
|
@ -469,6 +471,12 @@ module.exports = React.createClass({
|
|||
case 'load_completed':
|
||||
this._onLoadCompleted();
|
||||
break;
|
||||
case 'new_version':
|
||||
this.onVersion(
|
||||
payload.currentVersion, payload.newVersion,
|
||||
payload.releaseNotes
|
||||
);
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -961,11 +969,12 @@ module.exports = React.createClass({
|
|||
this.showScreen("settings");
|
||||
},
|
||||
|
||||
onVersion: function(current, latest) {
|
||||
onVersion: function(current, latest, releaseNotes) {
|
||||
this.setState({
|
||||
version: current,
|
||||
newVersion: latest,
|
||||
hasNewVersion: current !== latest
|
||||
hasNewVersion: current !== latest,
|
||||
newVersionReleaseNotes: releaseNotes,
|
||||
});
|
||||
},
|
||||
|
||||
|
@ -1100,7 +1109,9 @@ module.exports = React.createClass({
|
|||
|
||||
var topBar;
|
||||
if (this.state.hasNewVersion) {
|
||||
topBar = <NewVersionBar version={this.state.version} newVersion={this.state.newVersion} />;
|
||||
topBar = <NewVersionBar version={this.state.version} newVersion={this.state.newVersion}
|
||||
releaseNotes={this.state.newVersionReleaseNotes}
|
||||
/>;
|
||||
}
|
||||
else if (MatrixClientPeg.get().isGuest()) {
|
||||
topBar = <GuestWarningBar />;
|
||||
|
|
Loading…
Reference in a new issue