From 74a6c1e8d887f793cdd078d8e5634e948f5cae8c Mon Sep 17 00:00:00 2001 From: PunitLodha Date: Sun, 14 Feb 2021 18:21:12 +0530 Subject: [PATCH] Dont clear email if verification cancelled by user --- src/components/views/settings/account/EmailAddresses.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/views/settings/account/EmailAddresses.js b/src/components/views/settings/account/EmailAddresses.js index 07d2133e95..a8de7693a9 100644 --- a/src/components/views/settings/account/EmailAddresses.js +++ b/src/components/views/settings/account/EmailAddresses.js @@ -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});