From: Dessalines Date: Thu, 7 Jan 2021 18:55:09 +0000 (-0500) Subject: Fixing websockets. X-Git-Url: http://these/git/%22https:/www.exeterceilidhs.net/%22%7B%7D/%7Bthis.captchaPngSrc%28%29%7D?a=commitdiff_plain;h=c14ec3beb719bcae47710a217f9162bffdb6f72d;p=lemmy-ui.git Fixing websockets. --- diff --git a/src/shared/components/community.tsx b/src/shared/components/community.tsx index 6025e91..613c0c7 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 fbccf51..b84fe46 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 f7bf373..313e3c0 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); }