mirror of
https://github.com/LemmyNet/lemmy-ui.git
synced 2024-11-29 15:51:14 +00:00
Fixing websockets.
This commit is contained in:
parent
57a7de64c0
commit
c14ec3beb7
3 changed files with 4 additions and 4 deletions
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
|
@ -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 (
|
||||||
|
|
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue