From c1b72fd346b873b0b1336a38a5cbab4be61c0757 Mon Sep 17 00:00:00 2001 From: David Baker Date: Mon, 19 Aug 2019 15:17:14 +0100 Subject: [PATCH] Allow 3pids to be added with no ID server set Fixes https://github.com/vector-im/riot-web/issues/10573 --- .../tabs/user/GeneralUserSettingsTab.js | 25 ++++++++++++++----- 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/src/components/views/settings/tabs/user/GeneralUserSettingsTab.js b/src/components/views/settings/tabs/user/GeneralUserSettingsTab.js index b428ef51fa..7a8d123fcd 100644 --- a/src/components/views/settings/tabs/user/GeneralUserSettingsTab.js +++ b/src/components/views/settings/tabs/user/GeneralUserSettingsTab.js @@ -46,11 +46,17 @@ export default class GeneralUserSettingsTab extends React.Component { language: languageHandler.getCurrentLanguage(), theme: SettingsStore.getValueAt(SettingLevel.ACCOUNT, "theme"), haveIdServer: Boolean(MatrixClientPeg.get().getIdentityServerUrl()), + serverRequiresIdServer: null, }; this.dispatcherRef = dis.register(this._onAction); } + async componentWillMount() { + const serverRequiresIdServer = await MatrixClientPeg.get().doesServerRequireIdServerParam(); + this.setState({serverRequiresIdServer}); + } + componentWillUnmount() { dis.unregister(this.dispatcherRef); } @@ -127,6 +133,7 @@ export default class GeneralUserSettingsTab extends React.Component { const ChangePassword = sdk.getComponent("views.settings.ChangePassword"); const EmailAddresses = sdk.getComponent("views.settings.account.EmailAddresses"); const PhoneNumbers = sdk.getComponent("views.settings.account.PhoneNumbers"); + const Spinner = sdk.getComponent("views.elements.Spinner"); const passwordChangeForm = ( ); - const threepidSection = this.state.haveIdServer ?
- {_t("Email addresses")} - + let threepidSection = null; - {_t("Phone numbers")} - -
: null; + if (this.state.haveIdServer || this.state.serverRequiresIdServer === false) { + threepidSection =
+ {_t("Email addresses")} + + + {_t("Phone numbers")} + +
; + } else if (this.state.serverRequiresIdServer === null) { + threepidSection = ; + } return (