From 07826c567546f79901534e65ac3f9668361c2693 Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Mon, 19 Aug 2019 14:03:38 +0100 Subject: [PATCH] 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 --- .../settings/tabs/user/GeneralUserSettingsTab.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/components/views/settings/tabs/user/GeneralUserSettingsTab.js b/src/components/views/settings/tabs/user/GeneralUserSettingsTab.js index 08550db1d1..b428ef51fa 100644 --- a/src/components/views/settings/tabs/user/GeneralUserSettingsTab.js +++ b/src/components/views/settings/tabs/user/GeneralUserSettingsTab.js @@ -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 ?
+ {_t("Email addresses")} + + + {_t("Phone numbers")} + +
: null; + return (
- {_t("Email addresses")} - - - {_t("Phone numbers")} - + {threepidSection} { /* has its own heading as it includes the current ID server */ }