aboutsummaryrefslogtreecommitdiff
path: root/src/components/comments/AddComment.tsx
diff options
context:
space:
mode:
authorIvan Chen <ivan@thetaggid.com>2021-01-27 17:30:08 -0500
committerGitHub <noreply@github.com>2021-01-27 17:30:08 -0500
commit60d3d97ad6913369762877a9dbfdaac0473deb28 (patch)
treea643a1790d7bff35ea911341c59f5fbd7ab1f068 /src/components/comments/AddComment.tsx
parent21a3e000443c5c4ab2ae91000108b9d3b0383964 (diff)
parentfa589628285602136542b3f8944297dea34ddbf6 (diff)
Merge pull request #204 from IvanIFChen/tma568-delete-comments
[TMA-568] Delete Comments
Diffstat (limited to 'src/components/comments/AddComment.tsx')
-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,
);