From 9e96e8e87f8d6e7b7a04c063189d90037a51c7d8 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Thu, 8 Jun 2017 20:30:34 +0100 Subject: [PATCH] Remove guest-only bits of UserSettings There is now no way to open UserSettings as a guest, so we might as well lose the dead code. --- src/components/structures/UserSettings.js | 39 +++-------------------- 1 file changed, 5 insertions(+), 34 deletions(-) diff --git a/src/components/structures/UserSettings.js b/src/components/structures/UserSettings.js index e87bde6d87..e73f0335f0 100644 --- a/src/components/structures/UserSettings.js +++ b/src/components/structures/UserSettings.js @@ -310,11 +310,6 @@ module.exports = React.createClass({ }, onAvatarPickerClick: function(ev) { - if (MatrixClientPeg.get().isGuest()) { - dis.dispatch({action: 'view_set_mxid'}); - return; - } - if (this.refs.file_label) { this.refs.file_label.click(); } @@ -397,12 +392,6 @@ module.exports = React.createClass({ dis.dispatch({action: 'password_changed'}); }, - onUpgradeClicked: function() { - dis.dispatch({ - action: "start_upgrade_registration", - }); - }, - onEnableNotificationsChange: function(event) { UserSettingsStore.setEnableNotifications(event.target.checked); }, @@ -817,12 +806,6 @@ module.exports = React.createClass({ // TODO: this ought to be a separate component so that we don't need // to rebind the onChange each time we render const onChange = (e) => { - if (MatrixClientPeg.get().isGuest()) { - e.target.checked = false; - dis.dispatch({action: 'view_set_mxid'}); - return; - } - UserSettingsStore.setFeatureEnabled(feature.id, e.target.checked); this.forceUpdate(); }; @@ -852,9 +835,6 @@ module.exports = React.createClass({ }, _renderDeactivateAccount: function() { - // We can't deactivate a guest account. - if (MatrixClientPeg.get().isGuest()) return null; - return

{ _t("Deactivate Account") }

@@ -1111,7 +1091,7 @@ module.exports = React.createClass({ let addEmailSection; if (this.state.email_add_pending) { addEmailSection = ; - } else if (!MatrixClientPeg.get().isGuest()) { + } else { addEmailSection = (
@@ -1139,16 +1119,7 @@ module.exports = React.createClass({ threepidsSection.push(addEmailSection); threepidsSection.push(addMsisdnSection); - let accountJsx; - - if (MatrixClientPeg.get().isGuest()) { - accountJsx = ( -
- { _t("Create an account") } -
- ); - } else { - accountJsx = ( + const accountJsx = ( - ); - } + ); + let notificationArea; - if (!MatrixClientPeg.get().isGuest() && this.state.threepids !== undefined) { + if (this.state.threepids !== undefined) { notificationArea = (

{ _t("Notifications") }