diff options
Diffstat (limited to 'src/components/comments/AddComment.tsx')
-rw-r--r-- | src/components/comments/AddComment.tsx | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/components/comments/AddComment.tsx b/src/components/comments/AddComment.tsx index 46086e81..44f49748 100644 --- a/src/components/comments/AddComment.tsx +++ b/src/components/comments/AddComment.tsx @@ -40,8 +40,12 @@ const AddComment: React.FC<AddCommentProps> = ({ const {avatar} = useSelector((state: RootState) => state.user); const addComment = async () => { + const trimmed = comment.trim(); + if (trimmed === '') { + return; + } const postedComment = await postComment( - comment.trim(), + trimmed, objectId, isCommentInFocus, ); |