Fixing websockets.

This commit is contained in:
Dessalines 2021-01-07 13:55:09 -05:00
parent 57a7de64c0
commit c14ec3beb7
3 changed files with 4 additions and 4 deletions

View file

@ -533,7 +533,7 @@ export class Community extends Component<any, State> {
let data = wsJsonToRes<CommentResponse>(msg).data; let data = wsJsonToRes<CommentResponse>(msg).data;
// Necessary since it might be a user reply // 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.state.comments.unshift(data.comment_view);
this.setState(this.state); this.setState(this.state);
} }

View file

@ -798,7 +798,7 @@ export class Main extends Component<any, MainState> {
let data = wsJsonToRes<CommentResponse>(msg).data; let data = wsJsonToRes<CommentResponse>(msg).data;
// Necessary since it might be a user reply // 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 you're on subscribed, only push it if you're subscribed.
if (this.state.listingType == ListingType.Subscribed) { if (this.state.listingType == ListingType.Subscribed) {
if ( if (

View file

@ -479,8 +479,8 @@ export class Post extends Component<any, PostState> {
} else if (op == UserOperation.CreateComment) { } else if (op == UserOperation.CreateComment) {
let data = wsJsonToRes<CommentResponse>(msg).data; let data = wsJsonToRes<CommentResponse>(msg).data;
// Necessary since it might be a user reply // Necessary since it might be a user reply, which has the form_id removed
if (data.recipient_ids.length == 0) { if (data.form_id) {
this.state.postRes.comments.unshift(data.comment_view); this.state.postRes.comments.unshift(data.comment_view);
this.setState(this.state); this.setState(this.state);
} }