Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Hide 3PID discovery sections when no identity server
Browse files Browse the repository at this point in the history
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 element-hq/element-web#10528
  • Loading branch information
jryans committed Aug 19, 2019
1 parent cd26b73 commit 07826c5
Showing 1 changed file with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down

0 comments on commit 07826c5

Please sign in to comment.