Fix Bug 57690: current email when changing

This commit is contained in:
Viktor Fomin 2022-06-21 13:17:30 +03:00
parent 66cdf0bdaf
commit 6619e40896

View File

@ -15,13 +15,10 @@ class ChangeEmailDialogComponent extends React.Component {
constructor(props) {
super(props);
const { user } = props;
const { email } = user;
this.state = {
isEmailValid: true,
isRequestRunning: false,
email,
email: "",
hasError: false,
errorMessage: "",
emailErrors: [],
@ -32,14 +29,6 @@ class ChangeEmailDialogComponent extends React.Component {
window.addEventListener("keyup", this.onKeyPress);
}
componentDidUpdate(prevProps) {
const { user } = this.props;
const { email } = user;
if (prevProps.user.email !== email) {
this.setState({ email });
}
}
componentWillUnmount() {
window.removeEventListener("keyup", this.onKeyPress);
}
@ -156,6 +145,7 @@ class ChangeEmailDialogComponent extends React.Component {
onValidateInput={this.onValidateEmailInput}
onKeyUp={this.onKeyPress}
hasError={hasError}
placeholder={t("EnterEmail")}
/>
</FieldContainer>
</>