diff --git a/src/components/structures/LoggedInView.js b/src/components/structures/LoggedInView.js index 8b0bcaad68..051e49acda 100644 --- a/src/components/structures/LoggedInView.js +++ b/src/components/structures/LoggedInView.js @@ -212,6 +212,7 @@ export default React.createClass({ const HomePage = sdk.getComponent('structures.HomePage'); const MatrixToolbar = sdk.getComponent('globals.MatrixToolbar'); const NewVersionBar = sdk.getComponent('globals.NewVersionBar'); + const UpdateCheckBar = sdk.getComponent('globals.UpdateCheckBar'); const PasswordNagBar = sdk.getComponent('globals.PasswordNagBar'); let page_element; @@ -281,12 +282,14 @@ export default React.createClass({ break; } + let topBar; const isGuest = this.props.matrixClient.isGuest(); - var topBar; if (this.props.hasNewVersion) { topBar = ; + } else if (this.props.checkingForUpdate) { + topBar = ; } else if (this.state.userHasGeneratedPassword) { topBar = ; } else if (!isGuest && Notifier.supportsDesktopNotifications() && !Notifier.isEnabled() && !Notifier.isToolbarHidden()) { diff --git a/src/components/structures/MatrixChat.js b/src/components/structures/MatrixChat.js index 7773f4f38c..0992d486f6 100644 --- a/src/components/structures/MatrixChat.js +++ b/src/components/structures/MatrixChat.js @@ -157,6 +157,7 @@ module.exports = React.createClass({ newVersion: null, hasNewVersion: false, newVersionReleaseNotes: null, + checkingForUpdate: null, // Parameters used in the registration dance with the IS register_client_secret: null, @@ -555,6 +556,9 @@ module.exports = React.createClass({ payload.releaseNotes, ); break; + case 'check_updates': + this.setState({ checkingForUpdate: payload.value }); + break; case 'send_event': this.onSendEvent(payload.room_id, payload.event); break; @@ -1300,6 +1304,7 @@ module.exports = React.createClass({ newVersion: latest, hasNewVersion: current !== latest, newVersionReleaseNotes: releaseNotes, + checkingForUpdate: null, }); }, diff --git a/src/components/structures/UserSettings.js b/src/components/structures/UserSettings.js index c4cc60f077..9a5eb07cde 100644 --- a/src/components/structures/UserSettings.js +++ b/src/components/structures/UserSettings.js @@ -884,6 +884,21 @@ module.exports = React.createClass({ ; }, + _renderCheckUpdate: function() { + const platform = PlatformPeg.get(); + if ('canSelfUpdate' in platform && platform.canSelfUpdate() && 'startUpdateCheck' in platform) { + return
+

{_t('Updates')}

+
+ + {_t('Check for update')} + +
+
; + } + return
; + }, + _renderBulkOptions: function() { const invitedRooms = MatrixClientPeg.get().getRooms().filter((r) => { return r.hasMembershipState(this._me, "invite"); @@ -1285,6 +1300,8 @@ module.exports = React.createClass({
+ {this._renderCheckUpdate()} + {this._renderClearCache()} {this._renderDeactivateAccount()} diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index 7eb8beeafd..a4dcb2873f 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -894,6 +894,8 @@ "Online": "Online", "Idle": "Idle", "Offline": "Offline", + "Updates": "Updates", + "Check for update": "Check for update", "Start chatting": "Start chatting", "Start Chatting": "Start Chatting", "Click on the button below to start chatting!": "Click on the button below to start chatting!",