aboutsummaryrefslogtreecommitdiff
path: root/src/components
diff options
context:
space:
mode:
Diffstat (limited to 'src/components')
-rw-r--r--src/components/comments/AddComment.tsx6
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,
);