Skip to content

Commit

Permalink
fix handling of Change Password button
Browse files Browse the repository at this point in the history
  • Loading branch information
legrego committed Apr 15, 2019
1 parent 670a28a commit 08b0ac5
Showing 1 changed file with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -173,15 +173,14 @@ export class ChangePasswordForm extends Component<Props, State> {
};

private onChangePasswordClick = async () => {
const { isInvalid } = this.validateForm();
this.setState({ shouldValidate: true, currentPasswordError: false }, () => {
const { isInvalid } = this.validateForm();
if (isInvalid) {
return;
}

this.setState({ shouldValidate: true, currentPasswordError: false });

if (isInvalid) {
return;
}

this.setState({ changeInProgress: true }, () => this.performPasswordChange());
this.setState({ changeInProgress: true }, () => this.performPasswordChange());
});
};

private validateCurrentPassword = (shouldValidate = this.state.shouldValidate) => {
Expand Down

0 comments on commit 08b0ac5

Please sign in to comment.