summaryrefslogtreecommitdiffstats
path: root/ui/src/components/post.tsx
diff options
context:
space:
mode:
authorDessalines <tyhou13@gmx.com>2020-02-02 10:09:01 -0500
committerDessalines <tyhou13@gmx.com>2020-02-02 10:09:01 -0500
commitcda1e6e74141efea556e81082a3468a012d2926d (patch)
tree3ed9b86b8f8d80accc2c26ed3aaf0e12b8e189cd /ui/src/components/post.tsx
parent4d95be06b5145abdcb4f360439623269468dee35 (diff)
Fixing issue with multiple notifications.
Diffstat (limited to 'ui/src/components/post.tsx')
-rw-r--r--ui/src/components/post.tsx8
1 files changed, 6 insertions, 2 deletions
diff --git a/ui/src/components/post.tsx b/ui/src/components/post.tsx
index 99a20b46..fcf79438 100644
--- a/ui/src/components/post.tsx
+++ b/ui/src/components/post.tsx
@@ -400,8 +400,12 @@ export class Post extends Component<any, PostState> {
this.setState(this.state);
} else if (res.op == UserOperation.CreateComment) {
let data = res.data as CommentResponse;
- this.state.comments.unshift(data.comment);
- this.setState(this.state);
+
+ // Necessary since a user might receive a comment reply on another thread
+ if (data.comment.post_id == this.state.post.id) {
+ this.state.comments.unshift(data.comment);
+ this.setState(this.state);
+ }
} else if (res.op == UserOperation.EditComment) {
let data = res.data as CommentResponse;
let found = this.state.comments.find(c => c.id == data.comment.id);