From c14ec3beb719bcae47710a217f9162bffdb6f72d Mon Sep 17 00:00:00 2001 From: Dessalines Date: Thu, 7 Jan 2021 13:55:09 -0500 Subject: [PATCH] Fixing websockets. --- src/shared/components/community.tsx | 2 +- src/shared/components/main.tsx | 2 +- src/shared/components/post.tsx | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/shared/components/community.tsx b/src/shared/components/community.tsx index 6025e911..613c0c7c 100644 --- a/src/shared/components/community.tsx +++ b/src/shared/components/community.tsx @@ -533,7 +533,7 @@ export class Community extends Component { let data = wsJsonToRes(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); } diff --git a/src/shared/components/main.tsx b/src/shared/components/main.tsx index fbccf51a..b84fe463 100644 --- a/src/shared/components/main.tsx +++ b/src/shared/components/main.tsx @@ -798,7 +798,7 @@ export class Main extends Component { let data = wsJsonToRes(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 ( diff --git a/src/shared/components/post.tsx b/src/shared/components/post.tsx index f7bf3730..313e3c04 100644 --- a/src/shared/components/post.tsx +++ b/src/shared/components/post.tsx @@ -479,8 +479,8 @@ export class Post extends Component { } else if (op == UserOperation.CreateComment) { let data = wsJsonToRes(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); }