Dont clear email if verification cancelled by user

pull/21833/head
PunitLodha 2021-02-14 18:21:12 +05:30
parent 392b47e200
commit 74a6c1e8d8
1 changed files with 3 additions and 1 deletions

View File

@ -179,6 +179,7 @@ export default class EmailAddresses extends React.Component {
this.setState({continueDisabled: true});
this.state.addTask.checkEmailLinkClicked().then(([finished]) => {
let newEmailAddress = this.state.newEmailAddress;
if (finished) {
const email = this.state.newEmailAddress;
const emails = [
@ -186,12 +187,13 @@ export default class EmailAddresses extends React.Component {
{ address: email, medium: "email" },
];
this.props.onEmailsChange(emails);
newEmailAddress = "";
}
this.setState({
addTask: null,
continueDisabled: false,
verifying: false,
newEmailAddress: "",
newEmailAddress,
});
}).catch((err) => {
this.setState({continueDisabled: false});