Merge pull request #3323 from matrix-org/dbkr/add_3pid_without_is
Allow 3pids to be added with no ID server set
This commit is contained in:
commit
6879ddd34c
1 changed files with 19 additions and 6 deletions
|
@ -46,11 +46,17 @@ export default class GeneralUserSettingsTab extends React.Component {
|
||||||
language: languageHandler.getCurrentLanguage(),
|
language: languageHandler.getCurrentLanguage(),
|
||||||
theme: SettingsStore.getValueAt(SettingLevel.ACCOUNT, "theme"),
|
theme: SettingsStore.getValueAt(SettingLevel.ACCOUNT, "theme"),
|
||||||
haveIdServer: Boolean(MatrixClientPeg.get().getIdentityServerUrl()),
|
haveIdServer: Boolean(MatrixClientPeg.get().getIdentityServerUrl()),
|
||||||
|
serverRequiresIdServer: null,
|
||||||
};
|
};
|
||||||
|
|
||||||
this.dispatcherRef = dis.register(this._onAction);
|
this.dispatcherRef = dis.register(this._onAction);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async componentWillMount() {
|
||||||
|
const serverRequiresIdServer = await MatrixClientPeg.get().doesServerRequireIdServerParam();
|
||||||
|
this.setState({serverRequiresIdServer});
|
||||||
|
}
|
||||||
|
|
||||||
componentWillUnmount() {
|
componentWillUnmount() {
|
||||||
dis.unregister(this.dispatcherRef);
|
dis.unregister(this.dispatcherRef);
|
||||||
}
|
}
|
||||||
|
@ -127,6 +133,7 @@ export default class GeneralUserSettingsTab extends React.Component {
|
||||||
const ChangePassword = sdk.getComponent("views.settings.ChangePassword");
|
const ChangePassword = sdk.getComponent("views.settings.ChangePassword");
|
||||||
const EmailAddresses = sdk.getComponent("views.settings.account.EmailAddresses");
|
const EmailAddresses = sdk.getComponent("views.settings.account.EmailAddresses");
|
||||||
const PhoneNumbers = sdk.getComponent("views.settings.account.PhoneNumbers");
|
const PhoneNumbers = sdk.getComponent("views.settings.account.PhoneNumbers");
|
||||||
|
const Spinner = sdk.getComponent("views.elements.Spinner");
|
||||||
|
|
||||||
const passwordChangeForm = (
|
const passwordChangeForm = (
|
||||||
<ChangePassword
|
<ChangePassword
|
||||||
|
@ -137,13 +144,19 @@ export default class GeneralUserSettingsTab extends React.Component {
|
||||||
onFinished={this._onPasswordChanged} />
|
onFinished={this._onPasswordChanged} />
|
||||||
);
|
);
|
||||||
|
|
||||||
const threepidSection = this.state.haveIdServer ? <div>
|
let threepidSection = null;
|
||||||
<span className="mx_SettingsTab_subheading">{_t("Email addresses")}</span>
|
|
||||||
<EmailAddresses />
|
|
||||||
|
|
||||||
<span className="mx_SettingsTab_subheading">{_t("Phone numbers")}</span>
|
if (this.state.haveIdServer || this.state.serverRequiresIdServer === false) {
|
||||||
<PhoneNumbers />
|
threepidSection = <div>
|
||||||
</div> : null;
|
<span className="mx_SettingsTab_subheading">{_t("Email addresses")}</span>
|
||||||
|
<EmailAddresses />
|
||||||
|
|
||||||
|
<span className="mx_SettingsTab_subheading">{_t("Phone numbers")}</span>
|
||||||
|
<PhoneNumbers />
|
||||||
|
</div>;
|
||||||
|
} else if (this.state.serverRequiresIdServer === null) {
|
||||||
|
threepidSection = <Spinner />;
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="mx_SettingsTab_section mx_GeneralUserSettingsTab_accountSection">
|
<div className="mx_SettingsTab_section mx_GeneralUserSettingsTab_accountSection">
|
||||||
|
|
Loading…
Reference in a new issue