Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed: Posting empty comments #746

Merged

Conversation

VijayalakshmiGanesh
Copy link
Contributor

This PR fixes #740.

  1. Empty comments can't be posted anymore.
  2. Comments max length is set to 150 characters.

Copy link
Owner

@narayan954 narayan954 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me!

@@ -60,7 +61,7 @@ const CommentBox = ({

<IconButton
className="post__button"
disabled={!comment}
disabled={!comment || comment.trim().length < 1}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

won't comment.trim().length < 1 work the same as !comment? I think we wont need that

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

!comment checks if its not null, undefined. But comment.trim().length < 1 check if the comment is empty or contains only white spaces.

But you are right. In this LOC, !comment seems redundant.

@narayan954 narayan954 merged commit eec12f7 into narayan954:master Jul 12, 2023
4 of 5 checks passed
narayan954 added a commit to Palakkgoyal/dummygram that referenced this pull request Jul 13, 2023
* Fixed: Posting empty comments

* removed extra condition

* add changes back

---------

Co-authored-by: Narayan soni <narayansoni854@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

Validation is required for comments
2 participants