@@ -4,7 +4,7 @@ import Panel from '../Panel/Panel'
44import AddComment from '../ActionCard/AddComment'
55import Comment from '../ActionCard/Comment'
66import cn from 'classnames'
7- import { THREAD_MESSAGES_PAGE_SIZE } from '../../config/constants'
7+ // import { THREAD_MESSAGES_PAGE_SIZE } from '../../config/constants'
88
99const getCommentCount = ( totalComments ) => {
1010 if ( ! totalComments ) {
@@ -24,7 +24,7 @@ class FeedComments extends React.Component {
2424
2525 render ( ) {
2626 const {
27- comments, currentUser, totalComments, /* onLoadMoreComments,*/ isLoadingComments, hasMoreComments, onAdd,
27+ comments, currentUser, totalComments, onLoadMoreComments, isLoadingComments, hasMoreComments, onAdd,
2828 onChange, content, avatarUrl, isAddingComment
2929 } = this . props
3030 let authorName = currentUser . firstName
@@ -35,17 +35,17 @@ class FeedComments extends React.Component {
3535 this . setState ( { showAll : true } )
3636 // TODO - handle the case when a topic has more than 20 comments
3737 // since those will have to retrieved from the server
38- // if (!isLoadingComments) {
39- // onLoadMoreComments()
40- // }
38+ if ( ! isLoadingComments ) {
39+ onLoadMoreComments ( )
40+ }
4141 }
4242
43- let _comments = comments
44- let _hasMoreComments = hasMoreComments
45- if ( ! this . state . showAll && _comments . length > THREAD_MESSAGES_PAGE_SIZE ) {
46- _comments = _comments . slice ( - THREAD_MESSAGES_PAGE_SIZE )
47- _hasMoreComments = true
48- }
43+ // let _comments = comments
44+ // let _hasMoreComments = hasMoreComments
45+ // if (!this.state.showAll && _comments.length > THREAD_MESSAGES_PAGE_SIZE) {
46+ // _comments = _comments.slice(-THREAD_MESSAGES_PAGE_SIZE)
47+ // _hasMoreComments = true
48+ // }
4949
5050 return (
5151 < div >
@@ -57,15 +57,15 @@ class FeedComments extends React.Component {
5757 { getCommentCount ( totalComments ) }
5858 </ div >
5959 < hr className = { cn ( { 'no-margin' : ! comments . length } ) } />
60- { _hasMoreComments && < div className = { cn ( 'comment-collapse' , { 'loading-comments' : isLoadingComments } ) } >
60+ { hasMoreComments && < div className = { cn ( 'comment-collapse' , { 'loading-comments' : isLoadingComments } ) } >
6161 < a href = "javascript:" onClick = { handleLoadMoreClick } className = "comment-collapse-button" >
6262 { isLoadingComments ? 'Loading...' : 'View older comments' }
6363 </ a >
6464 </ div > }
6565 </ div >
6666 </ div >
6767 </ Panel . Body >
68- { _comments . map ( ( item , idx ) =>
68+ { comments . map ( ( item , idx ) =>
6969 < Comment
7070 key = { idx }
7171 avatarUrl = { item . author . photoURL }
0 commit comments