Skip to content

Commit

Permalink
Merge pull request #4607 from mananjadhav/fix/password-confirm-valida…
Browse files Browse the repository at this point in the history
…tion

Hide Password mismatch incase both the passwords are empty
  • Loading branch information
AndrewGable authored Aug 16, 2021
2 parents f975fbd + a2c7678 commit 10a422a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/pages/settings/PasswordPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,15 @@ class PasswordPage extends Component {

if (this.state.newPassword && this.state.confirmNewPassword && !this.doPasswordsMatch()) {
stateToUpdate.shouldShowPasswordConfirmError = true;
} else {
stateToUpdate.shouldShowPasswordConfirmError = false;
}

if (!isEmpty(stateToUpdate)) {
this.setState(stateToUpdate);
}
this.setState(stateToUpdate);
}

onBlurConfirmPassword() {
if (!this.state.confirmNewPassword || !this.doPasswordsMatch()) {
if ((this.state.newPassword && !this.state.confirmNewPassword) || !this.doPasswordsMatch()) {
this.setState({shouldShowPasswordConfirmError: true});
} else {
this.setState({shouldShowPasswordConfirmError: false});
Expand Down

0 comments on commit 10a422a

Please sign in to comment.