]> Untitled Git - lemmy-ui.git/commitdiff
Fixing websockets.
authorDessalines <tyhou13@gmx.com>
Thu, 7 Jan 2021 18:55:09 +0000 (13:55 -0500)
committerDessalines <tyhou13@gmx.com>
Thu, 7 Jan 2021 18:55:09 +0000 (13:55 -0500)
src/shared/components/community.tsx
src/shared/components/main.tsx
src/shared/components/post.tsx

index 6025e911e88339388aff151ba04ea1a8e2bcb952..613c0c7c178565704aa9d205dfb5f94384c62eb3 100644 (file)
@@ -533,7 +533,7 @@ export class Community extends Component<any, State> {
       let data = wsJsonToRes<CommentResponse>(msg).data;
 
       // Necessary since it might be a user reply
-      if (data.recipient_ids.length == 0) {
+      if (data.form_id) {
         this.state.comments.unshift(data.comment_view);
         this.setState(this.state);
       }
index fbccf51a6922df2d4c154ae814b1ea8dfd7a6ac5..b84fe46362f3f7e2876280178918b11924232919 100644 (file)
@@ -798,7 +798,7 @@ export class Main extends Component<any, MainState> {
       let data = wsJsonToRes<CommentResponse>(msg).data;
 
       // Necessary since it might be a user reply
-      if (data.recipient_ids.length == 0) {
+      if (data.form_id) {
         // If you're on subscribed, only push it if you're subscribed.
         if (this.state.listingType == ListingType.Subscribed) {
           if (
index f7bf3730efb3b77ff1bc82d0c3ca313289f3ded6..313e3c0460632671c7b9877ff1cb5c3955094cda 100644 (file)
@@ -479,8 +479,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
-      if (data.recipient_ids.length == 0) {
+      // Necessary since it might be a user reply, which has the form_id removed
+      if (data.form_id) {
         this.state.postRes.comments.unshift(data.comment_view);
         this.setState(this.state);
       }