mirror of
https://github.com/LemmyNet/lemmy-ui.git
synced 2024-11-25 07:36:37 +00:00
Fixing comment issue.
This commit is contained in:
parent
2d9baaea96
commit
9c57e6b33e
|
@ -444,6 +444,7 @@ export class Post extends Component<any, PostState> {
|
||||||
|
|
||||||
parseMessage(msg: any) {
|
parseMessage(msg: any) {
|
||||||
let op = wsUserOp(msg);
|
let op = wsUserOp(msg);
|
||||||
|
console.log(msg);
|
||||||
if (msg.error) {
|
if (msg.error) {
|
||||||
toast(i18n.t(msg.error), 'danger');
|
toast(i18n.t(msg.error), 'danger');
|
||||||
return;
|
return;
|
||||||
|
@ -479,8 +480,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, which has the form_id removed
|
// Necessary since it might be a user reply, which has the recipients, to avoid double
|
||||||
if (data.form_id) {
|
if (data.recipient_ids.length == 0) {
|
||||||
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