diff --git a/src/shared/components/Settings/Account/MyAccount/index.jsx b/src/shared/components/Settings/Account/MyAccount/index.jsx index 6bc2453fa3..b7ca45a6c9 100644 --- a/src/shared/components/Settings/Account/MyAccount/index.jsx +++ b/src/shared/components/Settings/Account/MyAccount/index.jsx @@ -134,6 +134,10 @@ export default class MyAccount extends ConsentComponent { } onUpdateNewEmailInput(e) { + const { profileState, updateEmailConflict } = this.props; + if (profileState.isEmailConflict) { + updateEmailConflict(false); + } const newEmail = e.target.value; const newState = { ...this.state }; const email = /^([0-9A-Za-z\-_\.+]+)@([0-9A-Za-z]+\.[a-z]{2,3}(\.[a-z]{2})?)$/g; @@ -383,7 +387,7 @@ export default class MyAccount extends ConsentComponent { isOpen, } = this.state; - const { updatingPassword, updatingProfile } = profileState; + const { updatingPassword, updatingProfile, isEmailConflict = false } = profileState; const { incorrectPassword } = settingsPageState; return ( @@ -576,6 +580,13 @@ export default class MyAccount extends ConsentComponent { ) } + { + isEmailConflict && ( +
+ The email you have entered is already in use. +
+ ) + }
{ + dispatch(actions.profile.updateEmailConflict(state)); + }, }; }