Skip to content

Commit 907ddf1

Browse files
author
Vikas Agarwal
committed
Github issue#625, Project 908: Dashboard stuck in infinite loop
-- Hotfix
1 parent 70b87fd commit 907ddf1

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

src/components/Feed/FeedComments.jsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import _ from 'lodash'
12
import React, {PropTypes} from 'react'
23
import moment from 'moment'
34
import 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>

src/components/MessageDetails/MessageDetails.jsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import _ from 'lodash'
12
import React, {PropTypes} from 'react'
23
import moment from 'moment'
34
import './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>

0 commit comments

Comments
 (0)