mirror of
https://github.com/element-hq/element-web
synced 2024-11-28 04:21:57 +03:00
Add email only if the verification is complete
This commit is contained in:
parent
fb499e54b3
commit
392b47e200
1 changed files with 9 additions and 7 deletions
|
@ -178,19 +178,21 @@ export default class EmailAddresses extends React.Component {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
this.setState({continueDisabled: true});
|
this.setState({continueDisabled: true});
|
||||||
this.state.addTask.checkEmailLinkClicked().then(() => {
|
this.state.addTask.checkEmailLinkClicked().then(([finished]) => {
|
||||||
const email = this.state.newEmailAddress;
|
if (finished) {
|
||||||
|
const email = this.state.newEmailAddress;
|
||||||
|
const emails = [
|
||||||
|
...this.props.emails,
|
||||||
|
{ address: email, medium: "email" },
|
||||||
|
];
|
||||||
|
this.props.onEmailsChange(emails);
|
||||||
|
}
|
||||||
this.setState({
|
this.setState({
|
||||||
addTask: null,
|
addTask: null,
|
||||||
continueDisabled: false,
|
continueDisabled: false,
|
||||||
verifying: false,
|
verifying: false,
|
||||||
newEmailAddress: "",
|
newEmailAddress: "",
|
||||||
});
|
});
|
||||||
const emails = [
|
|
||||||
...this.props.emails,
|
|
||||||
{ address: email, medium: "email" },
|
|
||||||
];
|
|
||||||
this.props.onEmailsChange(emails);
|
|
||||||
}).catch((err) => {
|
}).catch((err) => {
|
||||||
this.setState({continueDisabled: false});
|
this.setState({continueDisabled: false});
|
||||||
const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
|
const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
|
||||||
|
|
Loading…
Reference in a new issue