Hide 3PID discovery sections when no identity server

This hides the email and phone sections of Discovery in the Settings when there
is no IS, as they can't meaningfully be used.

Part of https://github.com/vector-im/riot-web/issues/10528
This commit is contained in:
J. Ryan Stinnett 2019-08-19 14:03:38 +01:00
parent cd26b73386
commit 07826c5675

View file

@ -189,13 +189,17 @@ export default class GeneralUserSettingsTab extends React.Component {
const PhoneNumbers = sdk.getComponent("views.settings.discovery.PhoneNumbers");
const SetIdServer = sdk.getComponent("views.settings.SetIdServer");
const threepidSection = this.state.haveIdServer ? <div>
<span className="mx_SettingsTab_subheading">{_t("Email addresses")}</span>
<EmailAddresses />
<span className="mx_SettingsTab_subheading">{_t("Phone numbers")}</span>
<PhoneNumbers />
</div> : null;
return (
<div className="mx_SettingsTab_section">
<span className="mx_SettingsTab_subheading">{_t("Email addresses")}</span>
<EmailAddresses />
<span className="mx_SettingsTab_subheading">{_t("Phone numbers")}</span>
<PhoneNumbers />
{threepidSection}
{ /* has its own heading as it includes the current ID server */ }
<SetIdServer />
</div>