Skip to content

Commit

Permalink
refactor return value
Browse files Browse the repository at this point in the history
  • Loading branch information
tienifr committed Jul 24, 2023
1 parent 62214a9 commit 77a77b3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/components/PDFView/PDFPasswordForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,17 +94,17 @@ class PDFPasswordForm extends Component {
}

validate() {
if (this.props.isPasswordInvalid) {
return false;
if (!this.props.isPasswordInvalid && !_.isEmpty(this.state.password)) {
return true;
}

if (_.isEmpty(this.state.password)) {
this.setState({
validationErrorText: 'attachmentView.passwordRequired',
});
return false;
}

return true;
return false;
}

validateAndNotifyPasswordBlur() {
Expand Down

0 comments on commit 77a77b3

Please sign in to comment.