Skip to content
Snippets Groups Projects
Commit d8b3a455 authored by Alexandru Munteanu's avatar Alexandru Munteanu
Browse files

fix(review reports): crash when recommendation has no comments

parent de8b9643
No related branches found
No related tags found
1 merge request!10Sprint #12
......@@ -10,12 +10,12 @@ import { FileItem } from 'pubsweet-components-faraday/src/components/Files'
import ShowMore from './ShowMore'
const ReviewReportCard = ({
i = 0,
report = {},
journal: { recommendations },
i = 0,
}) => {
const hasReviewer = !isEmpty(get(report, 'user'))
const { submittedOn, comments, user } = report
const { submittedOn, comments = [], user } = report
const submittedDate = moment(submittedOn).format('DD.MM.YYYY')
const publicComment = comments.find(c => c.public)
const privateComment = comments.find(c => !c.public)
......
......@@ -47,12 +47,12 @@ const getTabSections = (collectionId, reviewers, recommendations = []) => [
const ReviewsAndReports = ({
project,
version,
reviewers = [],
recommendations = [],
isReviewer,
currentUserIs,
report,
isReviewer,
review = {},
currentUserIs,
reviewers = [],
recommendations = [],
mappedRecommendations,
}) => (
<Fragment>
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment