@@ -367,7 +367,7 @@ class FeedView extends React.Component {
367367
368368 render ( ) {
369369 const { currentUser, currentMemberRole, isCreatingFeed, error, allMembers,
370- toggleNotificationRead, notifications, project, isSuperUser } = this . props
370+ toggleNotificationRead, notifications, project, isSuperUser, projectMembers } = this . props
371371 const { feeds, isNewPostMobileOpen, fullscreenFeedId } = this . state
372372 const isChanged = this . isChanged ( )
373373 const onLeaveMessage = this . onLeave ( ) || ''
@@ -393,6 +393,7 @@ class FeedView extends React.Component {
393393 allowComments : fullscreenFeed . allowComments && ! ! currentMemberRole ,
394394 currentUser,
395395 allMembers,
396+ projectMembers,
396397 onNewCommentChange : this . onNewCommentChange . bind ( this , fullscreenFeedId ) ,
397398 onAddNewComment : this . onAddNewComment . bind ( this , fullscreenFeedId ) ,
398399 onLoadMoreComments : this . onShowAllComments . bind ( this , fullscreenFeedId ) ,
@@ -432,6 +433,7 @@ class FeedView extends React.Component {
432433 < NewPost
433434 currentUser = { currentUser }
434435 allMembers = { allMembers }
436+ projectMembers = { projectMembers }
435437 onPost = { this . onNewPost }
436438 isCreating = { isCreatingFeed }
437439 hasError = { error }
@@ -452,6 +454,7 @@ class FeedView extends React.Component {
452454 allowComments : feed . allowComments && ! ! currentMemberRole ,
453455 currentUser,
454456 allMembers,
457+ projectMembers,
455458 onNewCommentChange : this . onNewCommentChange . bind ( this , feed . id ) ,
456459 onAddNewComment : this . onAddNewComment . bind ( this , feed . id ) ,
457460 onLoadMoreComments : this . onShowAllComments . bind ( this , feed . id ) ,
@@ -526,7 +529,9 @@ FeedContainer.PropTypes = {
526529 project : PropTypes . object . isRequired
527530}
528531
529- const mapStateToProps = ( { projectTopics, members, loadUser, notifications } ) => {
532+ const mapStateToProps = ( { projectTopics, members, loadUser, notifications, projectState } ) => {
533+ const project = projectState . project
534+ const projectMembers = _ . filter ( members . members , m => _ . some ( project . members , pm => pm . userId === m . userId ) )
530535 return {
531536 currentUser : loadUser . user ,
532537 feeds : projectTopics . feeds [ PROJECT_FEED_TYPE_PRIMARY ] . topics ,
@@ -535,6 +540,7 @@ const mapStateToProps = ({ projectTopics, members, loadUser, notifications }) =>
535540 isCreatingFeed : projectTopics . isCreatingFeed ,
536541 error : projectTopics . error ,
537542 allMembers : members . members ,
543+ projectMembers : _ . keyBy ( projectMembers , 'userId' ) ,
538544 notifications,
539545 }
540546}
0 commit comments