]> Untitled Git - lemmy-ui.git/commitdiff
Fixing comment issue.
authorDessalines <tyhou13@gmx.com>
Wed, 13 Jan 2021 17:06:56 +0000 (12:06 -0500)
committerDessalines <tyhou13@gmx.com>
Wed, 13 Jan 2021 17:06:56 +0000 (12:06 -0500)
src/shared/components/post.tsx

index 313e3c0460632671c7b9877ff1cb5c3955094cda..73d861ea0c1671db9384f99e972a29124a015fe2 100644 (file)
@@ -444,6 +444,7 @@ export class Post extends Component<any, PostState> {
 
   parseMessage(msg: any) {
     let op = wsUserOp(msg);
+    console.log(msg);
     if (msg.error) {
       toast(i18n.t(msg.error), 'danger');
       return;
@@ -479,8 +480,8 @@ export class Post extends Component<any, PostState> {
     } else if (op == UserOperation.CreateComment) {
       let data = wsJsonToRes<CommentResponse>(msg).data;
 
-      // Necessary since it might be a user reply, which has the form_id removed
-      if (data.form_id) {
+      // Necessary since it might be a user reply, which has the recipients, to avoid double
+      if (data.recipient_ids.length == 0) {
         this.state.postRes.comments.unshift(data.comment_view);
         this.setState(this.state);
       }