Merge pull request #1019 from matrix-org/t3chguy/updating_stuff
manual check for updates
This commit is contained in:
commit
ac3e039e2a
4 changed files with 29 additions and 2 deletions
|
@ -212,6 +212,7 @@ export default React.createClass({
|
||||||
const HomePage = sdk.getComponent('structures.HomePage');
|
const HomePage = sdk.getComponent('structures.HomePage');
|
||||||
const MatrixToolbar = sdk.getComponent('globals.MatrixToolbar');
|
const MatrixToolbar = sdk.getComponent('globals.MatrixToolbar');
|
||||||
const NewVersionBar = sdk.getComponent('globals.NewVersionBar');
|
const NewVersionBar = sdk.getComponent('globals.NewVersionBar');
|
||||||
|
const UpdateCheckBar = sdk.getComponent('globals.UpdateCheckBar');
|
||||||
const PasswordNagBar = sdk.getComponent('globals.PasswordNagBar');
|
const PasswordNagBar = sdk.getComponent('globals.PasswordNagBar');
|
||||||
|
|
||||||
let page_element;
|
let page_element;
|
||||||
|
@ -281,12 +282,14 @@ export default React.createClass({
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let topBar;
|
||||||
const isGuest = this.props.matrixClient.isGuest();
|
const isGuest = this.props.matrixClient.isGuest();
|
||||||
var topBar;
|
|
||||||
if (this.props.hasNewVersion) {
|
if (this.props.hasNewVersion) {
|
||||||
topBar = <NewVersionBar version={this.props.version} newVersion={this.props.newVersion}
|
topBar = <NewVersionBar version={this.props.version} newVersion={this.props.newVersion}
|
||||||
releaseNotes={this.props.newVersionReleaseNotes}
|
releaseNotes={this.props.newVersionReleaseNotes}
|
||||||
/>;
|
/>;
|
||||||
|
} else if (this.props.checkingForUpdate) {
|
||||||
|
topBar = <UpdateCheckBar {...this.props.checkingForUpdate} />;
|
||||||
} else if (this.state.userHasGeneratedPassword) {
|
} else if (this.state.userHasGeneratedPassword) {
|
||||||
topBar = <PasswordNagBar />;
|
topBar = <PasswordNagBar />;
|
||||||
} else if (!isGuest && Notifier.supportsDesktopNotifications() && !Notifier.isEnabled() && !Notifier.isToolbarHidden()) {
|
} else if (!isGuest && Notifier.supportsDesktopNotifications() && !Notifier.isEnabled() && !Notifier.isToolbarHidden()) {
|
||||||
|
|
|
@ -157,6 +157,7 @@ module.exports = React.createClass({
|
||||||
newVersion: null,
|
newVersion: null,
|
||||||
hasNewVersion: false,
|
hasNewVersion: false,
|
||||||
newVersionReleaseNotes: null,
|
newVersionReleaseNotes: null,
|
||||||
|
checkingForUpdate: null,
|
||||||
|
|
||||||
// Parameters used in the registration dance with the IS
|
// Parameters used in the registration dance with the IS
|
||||||
register_client_secret: null,
|
register_client_secret: null,
|
||||||
|
@ -555,6 +556,9 @@ module.exports = React.createClass({
|
||||||
payload.releaseNotes,
|
payload.releaseNotes,
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
|
case 'check_updates':
|
||||||
|
this.setState({ checkingForUpdate: payload.value });
|
||||||
|
break;
|
||||||
case 'send_event':
|
case 'send_event':
|
||||||
this.onSendEvent(payload.room_id, payload.event);
|
this.onSendEvent(payload.room_id, payload.event);
|
||||||
break;
|
break;
|
||||||
|
@ -1300,6 +1304,7 @@ module.exports = React.createClass({
|
||||||
newVersion: latest,
|
newVersion: latest,
|
||||||
hasNewVersion: current !== latest,
|
hasNewVersion: current !== latest,
|
||||||
newVersionReleaseNotes: releaseNotes,
|
newVersionReleaseNotes: releaseNotes,
|
||||||
|
checkingForUpdate: null,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -884,6 +884,21 @@ module.exports = React.createClass({
|
||||||
</div>;
|
</div>;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
_renderCheckUpdate: function() {
|
||||||
|
const platform = PlatformPeg.get();
|
||||||
|
if ('canSelfUpdate' in platform && platform.canSelfUpdate() && 'startUpdateCheck' in platform) {
|
||||||
|
return <div>
|
||||||
|
<h3>{_t('Updates')}</h3>
|
||||||
|
<div className="mx_UserSettings_section">
|
||||||
|
<AccessibleButton className="mx_UserSettings_button" onClick={platform.startUpdateCheck}>
|
||||||
|
{_t('Check for update')}
|
||||||
|
</AccessibleButton>
|
||||||
|
</div>
|
||||||
|
</div>;
|
||||||
|
}
|
||||||
|
return <div />;
|
||||||
|
},
|
||||||
|
|
||||||
_renderBulkOptions: function() {
|
_renderBulkOptions: function() {
|
||||||
const invitedRooms = MatrixClientPeg.get().getRooms().filter((r) => {
|
const invitedRooms = MatrixClientPeg.get().getRooms().filter((r) => {
|
||||||
return r.hasMembershipState(this._me, "invite");
|
return r.hasMembershipState(this._me, "invite");
|
||||||
|
@ -1285,6 +1300,8 @@ module.exports = React.createClass({
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{this._renderCheckUpdate()}
|
||||||
|
|
||||||
{this._renderClearCache()}
|
{this._renderClearCache()}
|
||||||
|
|
||||||
{this._renderDeactivateAccount()}
|
{this._renderDeactivateAccount()}
|
||||||
|
|
|
@ -894,6 +894,8 @@
|
||||||
"Online": "Online",
|
"Online": "Online",
|
||||||
"Idle": "Idle",
|
"Idle": "Idle",
|
||||||
"Offline": "Offline",
|
"Offline": "Offline",
|
||||||
|
"Updates": "Updates",
|
||||||
|
"Check for update": "Check for update",
|
||||||
"Start chatting": "Start chatting",
|
"Start chatting": "Start chatting",
|
||||||
"Start Chatting": "Start Chatting",
|
"Start Chatting": "Start Chatting",
|
||||||
"Click on the button below to start chatting!": "Click on the button below to start chatting!",
|
"Click on the button below to start chatting!": "Click on the button below to start chatting!",
|
||||||
|
|
Loading…
Reference in a new issue