mirror of
https://github.com/vector-im/element-web.git
synced 2024-11-17 14:05:04 +08:00
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.
This commit is contained in:
parent
56efe7d2f2
commit
9e96e8e87f
@ -310,11 +310,6 @@ module.exports = React.createClass({
|
|||||||
},
|
},
|
||||||
|
|
||||||
onAvatarPickerClick: function(ev) {
|
onAvatarPickerClick: function(ev) {
|
||||||
if (MatrixClientPeg.get().isGuest()) {
|
|
||||||
dis.dispatch({action: 'view_set_mxid'});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.refs.file_label) {
|
if (this.refs.file_label) {
|
||||||
this.refs.file_label.click();
|
this.refs.file_label.click();
|
||||||
}
|
}
|
||||||
@ -397,12 +392,6 @@ module.exports = React.createClass({
|
|||||||
dis.dispatch({action: 'password_changed'});
|
dis.dispatch({action: 'password_changed'});
|
||||||
},
|
},
|
||||||
|
|
||||||
onUpgradeClicked: function() {
|
|
||||||
dis.dispatch({
|
|
||||||
action: "start_upgrade_registration",
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
onEnableNotificationsChange: function(event) {
|
onEnableNotificationsChange: function(event) {
|
||||||
UserSettingsStore.setEnableNotifications(event.target.checked);
|
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
|
// TODO: this ought to be a separate component so that we don't need
|
||||||
// to rebind the onChange each time we render
|
// to rebind the onChange each time we render
|
||||||
const onChange = (e) => {
|
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);
|
UserSettingsStore.setFeatureEnabled(feature.id, e.target.checked);
|
||||||
this.forceUpdate();
|
this.forceUpdate();
|
||||||
};
|
};
|
||||||
@ -852,9 +835,6 @@ module.exports = React.createClass({
|
|||||||
},
|
},
|
||||||
|
|
||||||
_renderDeactivateAccount: function() {
|
_renderDeactivateAccount: function() {
|
||||||
// We can't deactivate a guest account.
|
|
||||||
if (MatrixClientPeg.get().isGuest()) return null;
|
|
||||||
|
|
||||||
return <div>
|
return <div>
|
||||||
<h3>{ _t("Deactivate Account") }</h3>
|
<h3>{ _t("Deactivate Account") }</h3>
|
||||||
<div className="mx_UserSettings_section">
|
<div className="mx_UserSettings_section">
|
||||||
@ -1111,7 +1091,7 @@ module.exports = React.createClass({
|
|||||||
let addEmailSection;
|
let addEmailSection;
|
||||||
if (this.state.email_add_pending) {
|
if (this.state.email_add_pending) {
|
||||||
addEmailSection = <Loader key="_email_add_spinner" />;
|
addEmailSection = <Loader key="_email_add_spinner" />;
|
||||||
} else if (!MatrixClientPeg.get().isGuest()) {
|
} else {
|
||||||
addEmailSection = (
|
addEmailSection = (
|
||||||
<div className="mx_UserSettings_profileTableRow" key="_newEmail">
|
<div className="mx_UserSettings_profileTableRow" key="_newEmail">
|
||||||
<div className="mx_UserSettings_profileLabelCell">
|
<div className="mx_UserSettings_profileLabelCell">
|
||||||
@ -1139,16 +1119,7 @@ module.exports = React.createClass({
|
|||||||
threepidsSection.push(addEmailSection);
|
threepidsSection.push(addEmailSection);
|
||||||
threepidsSection.push(addMsisdnSection);
|
threepidsSection.push(addMsisdnSection);
|
||||||
|
|
||||||
let accountJsx;
|
const accountJsx = (
|
||||||
|
|
||||||
if (MatrixClientPeg.get().isGuest()) {
|
|
||||||
accountJsx = (
|
|
||||||
<div className="mx_UserSettings_button" onClick={this.onUpgradeClicked}>
|
|
||||||
{ _t("Create an account") }
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
accountJsx = (
|
|
||||||
<ChangePassword
|
<ChangePassword
|
||||||
className="mx_UserSettings_accountTable"
|
className="mx_UserSettings_accountTable"
|
||||||
rowClassName="mx_UserSettings_profileTableRow"
|
rowClassName="mx_UserSettings_profileTableRow"
|
||||||
@ -1158,9 +1129,9 @@ module.exports = React.createClass({
|
|||||||
onError={this.onPasswordChangeError}
|
onError={this.onPasswordChangeError}
|
||||||
onFinished={this.onPasswordChanged} />
|
onFinished={this.onPasswordChanged} />
|
||||||
);
|
);
|
||||||
}
|
|
||||||
let notificationArea;
|
let notificationArea;
|
||||||
if (!MatrixClientPeg.get().isGuest() && this.state.threepids !== undefined) {
|
if (this.state.threepids !== undefined) {
|
||||||
notificationArea = (<div>
|
notificationArea = (<div>
|
||||||
<h3>{ _t("Notifications") }</h3>
|
<h3>{ _t("Notifications") }</h3>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user