Dont clear email if verification cancelled by user

This commit is contained in:
PunitLodha 2021-02-14 18:21:12 +05:30
parent 392b47e200
commit 74a6c1e8d8

View file

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