Update 3pids section visibility when id server set / unset
This commit is contained in:
parent
c80c8dcf24
commit
7c35107a37
2 changed files with 17 additions and 2 deletions
|
@ -45,9 +45,22 @@ export default class GeneralUserSettingsTab extends React.Component {
|
|||
this.state = {
|
||||
language: languageHandler.getCurrentLanguage(),
|
||||
theme: SettingsStore.getValueAt(SettingLevel.ACCOUNT, "theme"),
|
||||
haveIdServer: Boolean(MatrixClientPeg.get().getIdentityServerUrl()),
|
||||
};
|
||||
|
||||
this.dispatcherRef = dis.register(this._onAction);
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
dis.unregister(this.dispatcherRef);
|
||||
}
|
||||
|
||||
_onAction = (payload) => {
|
||||
if (payload.action === 'id_server_changed') {
|
||||
this.setState({haveIdServer: Boolean(MatrixClientPeg.get().getIdentityServerUrl())});
|
||||
}
|
||||
};
|
||||
|
||||
_onLanguageChange = (newLanguage) => {
|
||||
if (this.state.language === newLanguage) return;
|
||||
|
||||
|
@ -124,7 +137,7 @@ export default class GeneralUserSettingsTab extends React.Component {
|
|||
onFinished={this._onPasswordChanged} />
|
||||
);
|
||||
|
||||
const threepidSection = MatrixClientPeg.get().getIdentityServerUrl() ? <div>
|
||||
const threepidSection = this.state.haveIdServer ? <div>
|
||||
<span className="mx_SettingsTab_subheading">{_t("Email addresses")}</span>
|
||||
<EmailAddresses />
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue