diff --git a/plugins/talk-plugin-local-auth/client/components/ChangeEmailContentDialog.js b/plugins/talk-plugin-local-auth/client/components/ChangeEmailContentDialog.js index 62540927f..f29dd8d86 100644 --- a/plugins/talk-plugin-local-auth/client/components/ChangeEmailContentDialog.js +++ b/plugins/talk-plugin-local-auth/client/components/ChangeEmailContentDialog.js @@ -18,10 +18,18 @@ class ChangeEmailContentDialog extends React.Component { confirmChanges = async e => { e.preventDefault(); + + if (this.formHasError()) { + this.showError(); + return; + } + await this.props.save(); this.props.next(); }; + formHasError = () => this.props.hasError('confirmPassword'); + render() { return (
@@ -53,15 +61,10 @@ class ChangeEmailContentDialog extends React.Component { type="password" onChange={this.props.onChange} defaultValue="" - hasError={ - !this.props.formData.confirmPassword && this.state.showError - } - errorMsg={t( - 'talk-plugin-local-auth.change_email.incorrect_password' - )} + hasError={this.props.hasError('confirmPassword')} + errorMsg={this.props.getError('confirmPassword')} showError={this.state.showError} columnDisplay - showSuccess={false} />