summaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
authorReed Garmsen <rgarmsen2295@gmail.com>2015-10-28 15:22:31 -0700
committerReed Garmsen <rgarmsen2295@gmail.com>2015-10-30 13:08:40 -0700
commit713380df1c5e0015e125d44a2c132523dcacf4d0 (patch)
treeffc29f9e79f55856b6dee5d363c26aec722e785f /web
parent84faccb7b74dba773cd72e2d0cebdd5bf6a34566 (diff)
downloadchat-713380df1c5e0015e125d44a2c132523dcacf4d0.tar.gz
chat-713380df1c5e0015e125d44a2c132523dcacf4d0.tar.bz2
chat-713380df1c5e0015e125d44a2c132523dcacf4d0.zip
Fixed various issues with commenting on recently deleted posts
Diffstat (limited to 'web')
-rw-r--r--web/react/components/post_info.jsx2
-rw-r--r--web/react/components/post_list.jsx5
2 files changed, 6 insertions, 1 deletions
diff --git a/web/react/components/post_info.jsx b/web/react/components/post_info.jsx
index 6937ec216..ddda48e06 100644
--- a/web/react/components/post_info.jsx
+++ b/web/react/components/post_info.jsx
@@ -126,7 +126,7 @@ export default class PostInfo extends React.Component {
lastCommentClass = ' comment-icon__container__show';
}
- if (this.props.commentCount >= 1 && post.state !== Constants.POST_FAILED && post.state !== Constants.POST_LOADING) {
+ if (this.props.commentCount >= 1 && post.state !== Constants.POST_FAILED && post.state !== Constants.POST_LOADING && post.state !== Constants.POST_DELETED) {
comments = (
<a
href='#'
diff --git a/web/react/components/post_list.jsx b/web/react/components/post_list.jsx
index b9741bac4..444736db5 100644
--- a/web/react/components/post_list.jsx
+++ b/web/react/components/post_list.jsx
@@ -556,6 +556,11 @@ export default class PostList extends React.Component {
var post = posts[order[i]];
var parentPost = posts[post.parent_id];
+ // If the post is a comment whose parent has been deleted, don't add it to the list.
+ if (parentPost && parentPost.state === Constants.POST_DELETED) {
+ continue;
+ }
+
var sameUser = false;
var sameRoot = false;
var hideProfilePic = false;