diff options
author | Corey Hulen <corey@hulen.com> | 2015-09-02 12:41:47 -0700 |
---|---|---|
committer | Corey Hulen <corey@hulen.com> | 2015-09-02 12:41:47 -0700 |
commit | c7cafb6ac7404b62f38b48d3ec5782863abf203a (patch) | |
tree | fcf0970fa47942ca3a2431f21919271e1305a925 /web/react/components/post_list.jsx | |
parent | b31be3afa70a015afab864677545aafa3af8e1eb (diff) | |
parent | 63bc243b179f2c1f7b51ad2252f698907d2cde59 (diff) | |
download | chat-c7cafb6ac7404b62f38b48d3ec5782863abf203a.tar.gz chat-c7cafb6ac7404b62f38b48d3ec5782863abf203a.tar.bz2 chat-c7cafb6ac7404b62f38b48d3ec5782863abf203a.zip |
Merge pull request #553 from mattermost/MM-2065
MM-2065 Cosmetic refactoring for ESLint
Diffstat (limited to 'web/react/components/post_list.jsx')
-rw-r--r-- | web/react/components/post_list.jsx | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/web/react/components/post_list.jsx b/web/react/components/post_list.jsx index c1e6e490d..8587b981d 100644 --- a/web/react/components/post_list.jsx +++ b/web/react/components/post_list.jsx @@ -51,8 +51,10 @@ export default class PostList extends React.Component { if (deletedPosts && Object.keys(deletedPosts).length > 0) { for (var pid in deletedPosts) { - postList.posts[pid] = deletedPosts[pid]; - postList.order.unshift(pid); + if (deletedPosts.hasOwnProperty(pid)) { + postList.posts[pid] = deletedPosts[pid]; + postList.order.unshift(pid); + } } postList.order.sort(function postSort(a, b) { @@ -71,7 +73,9 @@ export default class PostList extends React.Component { if (pendingPostList) { postList.order = pendingPostList.order.concat(postList.order); for (var ppid in pendingPostList.posts) { - postList.posts[ppid] = pendingPostList.posts[ppid]; + if (pendingPostList.posts.hasOwnProperty(ppid)) { + postList.posts[ppid] = pendingPostList.posts[ppid]; + } } } } @@ -267,7 +271,6 @@ export default class PostList extends React.Component { } } onSocketChange(msg) { - var postList; var post; if (msg.action === 'posted' || msg.action === 'post_edited') { post = JSON.parse(msg.props.post); @@ -280,7 +283,6 @@ export default class PostList extends React.Component { } post = JSON.parse(msg.props.post); - postList = this.state.postList; PostStore.storeUnseenDeletedPost(post); PostStore.removePost(post, true); @@ -644,11 +646,18 @@ export default class PostList extends React.Component { if (posts && this.state.isFirstLoadComplete) { postCtls = this.createPosts(posts, order); } else { - postCtls.push(<LoadingScreen position='absolute' />); + postCtls.push( + <LoadingScreen + position='absolute' + key='loading' + />); } return ( - <div ref='postlist' className='post-list-holder-by-time'> + <div + ref='postlist' + className='post-list-holder-by-time' + > <div className='post-list__table'> <div className='post-list__content'> {moreMessages} @@ -658,4 +667,4 @@ export default class PostList extends React.Component { </div> ); } -} +}
\ No newline at end of file |