Better error detection

This commit is contained in:
Chi Vinh Le
2017-09-16 01:30:26 +07:00
parent 4567b4565f
commit aa4f781d25
@@ -201,7 +201,7 @@ class Stream extends React.Component {
data,
root,
appendItemArray,
root: {asset, asset: {comment: highlightedComment, comments}},
root: {asset, asset: {comment: highlightedComment}},
postComment,
notify,
updateItem,
@@ -222,12 +222,8 @@ class Stream extends React.Component {
const slotProps = {data};
const slotQueryData = {root, asset};
if (!highlightedComment && !comments) {
if (highlightedComment === null) {
return <StreamError>{t('stream.comment_not_found')}</StreamError>;
}
console.error('Talk: No comments came back from the graph given that query. Please, check the query params.');
return <StreamError>{t('common.error')}</StreamError>;
if (highlightedComment === null) {
return <StreamError>{t('stream.comment_not_found')}</StreamError>;
}
return (