File tree Expand file tree Collapse file tree 2 files changed +8
-6
lines changed
Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change 1+ import _ from 'lodash'
12import React , { PropTypes } from 'react'
23import moment from 'moment'
34import Panel from '../Panel/Panel'
@@ -68,11 +69,11 @@ class FeedComments extends React.Component {
6869 { comments . map ( ( item , idx ) =>
6970 < Comment
7071 key = { idx }
71- avatarUrl = { item . author . photoURL }
72- authorName = { item . author . firstName + ' ' + item . author . lastName }
72+ avatarUrl = { _ . get ( item , ' author.photoURL' , null ) }
73+ authorName = { item . author ? ( item . author . firstName + ' ' + item . author . lastName ) : 'Not Available' }
7374 date = { moment ( item . date ) . fromNow ( ) }
7475 active = { item . unread }
75- self = { item . author . userId === currentUser . userId }
76+ self = { item . author && item . author . userId === currentUser . userId }
7677 >
7778 < div dangerouslySetInnerHTML = { { __html : item . content } } />
7879 </ Comment >
Original file line number Diff line number Diff line change 1+ import _ from 'lodash'
12import React , { PropTypes } from 'react'
23import moment from 'moment'
34import './MessageDetails.scss'
@@ -44,11 +45,11 @@ class MessageDetails extends React.Component {
4445 { messages && messages . map ( ( item , idx ) =>
4546 < Comment
4647 key = { idx }
47- avatarUrl = { item . author . photoURL }
48- authorName = { item . author . firstName + ' ' + item . author . lastName }
48+ avatarUrl = { _ . get ( item , ' author.photoURL' , null ) }
49+ authorName = { item . author ? ( item . author . firstName + ' ' + item . author . lastName ) : 'Not Available' }
4950 date = { moment ( item . date ) . fromNow ( ) }
5051 active = { item . unread }
51- self = { item . author . userId === currentUser . userId }
52+ self = { item . author && item . author . userId === currentUser . userId }
5253 >
5354 < div dangerouslySetInnerHTML = { { __html : item . content } } />
5455 </ Comment >
You can’t perform that action at this time.
0 commit comments