Skip to content

Commit

Permalink
Merge pull request #8844 from frenkield/fix-7971-backticks
Browse files Browse the repository at this point in the history
[#7971] Disable send if only backticks/whitespace
  • Loading branch information
AndrewGable authored May 4, 2022
2 parents 569289b + 70cf26a commit a1dc52c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/pages/home/report/ReportActionCompose.js
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ class ReportActionCompose extends React.Component {
updateComment(newComment) {
this.textInput.setNativeProps({text: newComment});
this.setState({
isCommentEmpty: newComment.trim().length === 0,
isCommentEmpty: !!newComment.match(/^(\s|`)*$/),
});

// Indicate that draft has been created.
Expand Down Expand Up @@ -368,7 +368,7 @@ class ReportActionCompose extends React.Component {
const trimmedComment = this.comment.trim();

// Don't submit empty comments or comments that exceed the character limit
if (!trimmedComment || trimmedComment.length > CONST.MAX_COMMENT_LENGTH) {
if (this.state.isCommentEmpty || trimmedComment.length > CONST.MAX_COMMENT_LENGTH) {
return;
}

Expand Down

0 comments on commit a1dc52c

Please sign in to comment.