summaryrefslogtreecommitdiffstats
path: root/webapp/components/post_view
diff options
context:
space:
mode:
authorHarrison Healey <harrisonmhealey@gmail.com>2016-11-08 11:47:42 -0500
committerGitHub <noreply@github.com>2016-11-08 11:47:42 -0500
commit13dcccc60bba90f0883aae63e72aac896a6f553c (patch)
treea51b6b72fbd9fe5ef3d8e2e4c7279b790cbf015f /webapp/components/post_view
parentcb281ac714309eb54bfe96de45756999c4658a3c (diff)
downloadchat-13dcccc60bba90f0883aae63e72aac896a6f553c.tar.gz
chat-13dcccc60bba90f0883aae63e72aac896a6f553c.tar.bz2
chat-13dcccc60bba90f0883aae63e72aac896a6f553c.zip
PLT-4205 Fixed pending posts always being considered as part of a post thread (#4488)
Diffstat (limited to 'webapp/components/post_view')
-rw-r--r--webapp/components/post_view/components/post_list.jsx12
1 files changed, 7 insertions, 5 deletions
diff --git a/webapp/components/post_view/components/post_list.jsx b/webapp/components/post_view/components/post_list.jsx
index 400f516cc..a0cfb208e 100644
--- a/webapp/components/post_view/components/post_list.jsx
+++ b/webapp/components/post_view/components/post_list.jsx
@@ -272,11 +272,13 @@ export default class PostList extends React.Component {
commentRootId = post.id;
}
- for (const postId in posts) {
- if (posts[postId].root_id === commentRootId) {
- commentCount += 1;
- if (posts[postId].user_id === userId) {
- shouldHighlightThreads = true;
+ if (commentRootId) {
+ for (const postId in posts) {
+ if (posts[postId].root_id === commentRootId) {
+ commentCount += 1;
+ if (posts[postId].user_id === userId) {
+ shouldHighlightThreads = true;
+ }
}
}
}