summaryrefslogtreecommitdiffstats
path: root/web/react/components/rhs_thread.jsx
diff options
context:
space:
mode:
author=Corey Hulen <corey@hulen.com>2015-09-01 17:06:31 -0700
committer=Corey Hulen <corey@hulen.com>2015-09-01 17:06:31 -0700
commitf578bb1e48ec4d97bca92c7faf0dd8ed5aeceb39 (patch)
tree8b4f68e847984949b8362a30d40f13db2c4bcd52 /web/react/components/rhs_thread.jsx
parent72575ac7bdd5bfe7bd544ba238f8d1c0126635aa (diff)
downloadchat-f578bb1e48ec4d97bca92c7faf0dd8ed5aeceb39.tar.gz
chat-f578bb1e48ec4d97bca92c7faf0dd8ed5aeceb39.tar.bz2
chat-f578bb1e48ec4d97bca92c7faf0dd8ed5aeceb39.zip
MM-2065 style refactoring
Diffstat (limited to 'web/react/components/rhs_thread.jsx')
-rw-r--r--web/react/components/rhs_thread.jsx17
1 files changed, 12 insertions, 5 deletions
diff --git a/web/react/components/rhs_thread.jsx b/web/react/components/rhs_thread.jsx
index adddeccf0..dbb16872e 100644
--- a/web/react/components/rhs_thread.jsx
+++ b/web/react/components/rhs_thread.jsx
@@ -33,7 +33,9 @@ export default class RhsThread extends React.Component {
if (pendingPostList) {
for (var pid in pendingPostList.posts) {
- postList.posts[pid] = pendingPostList.posts[pid];
+ if (pendingPostList.posts.hasOwnProperty(pid)) {
+ postList.posts[pid] = pendingPostList.posts[pid];
+ }
}
}
@@ -81,7 +83,9 @@ export default class RhsThread extends React.Component {
if (currentPosts.posts[currentPosts.order[0]].channel_id === currentSelected.posts[currentSelected.order[0]].channel_id) {
currentSelected.posts = {};
for (var postId in currentPosts.posts) {
- currentSelected.posts[postId] = currentPosts.posts[postId];
+ if (currentPosts.posts.hasOwnProperty(postId)) {
+ currentSelected.posts[postId] = currentPosts.posts[postId];
+ }
}
PostStore.storeSelectedPost(currentSelected);
@@ -128,9 +132,11 @@ export default class RhsThread extends React.Component {
var postsArray = [];
for (var postId in postList.posts) {
- var cpost = postList.posts[postId];
- if (cpost.root_id === rootPost.id) {
- postsArray.push(cpost);
+ if (postList.posts.hasOwnProperty(postId)) {
+ var cpost = postList.posts[postId];
+ if (cpost.root_id === rootPost.id) {
+ postsArray.push(cpost);
+ }
}
}
@@ -209,6 +215,7 @@ RhsThread.defaultProps = {
fromSearch: '',
isMentionSearch: false
};
+
RhsThread.propTypes = {
fromSearch: React.PropTypes.string,
isMentionSearch: React.PropTypes.bool