diff --git a/packages/xpub-faraday/config/authsome-helpers.js b/packages/xpub-faraday/config/authsome-helpers.js index 0e41ba0d974864c19040d6085ec065c8d52f29f3..af24148066d5dc53764e440da68fb2c965436f2d 100644 --- a/packages/xpub-faraday/config/authsome-helpers.js +++ b/packages/xpub-faraday/config/authsome-helpers.js @@ -124,8 +124,8 @@ const stripeFragmentByRole = ({ user = {}, isLast = false, }) => { - const { files, authors, recommendations } = fragment - let recommendationsFromFragment + const { files, authors, recommendations = [] } = fragment + let recommendationsFromFragment = [] switch (role) { case 'author': return { @@ -135,17 +135,17 @@ const stripeFragmentByRole = ({ : [], } case 'reviewer': - if (isLast && recommendations) { + if (isLast) { recommendationsFromFragment = filterRecommendationsFromLastVersion( recommendations, user, ) - } else if (recommendations) { + } else { recommendationsFromFragment = filterRecommendationsFromOlderVersions( recommendations, user, ) - } else recommendationsFromFragment = [] + } return { ...fragment, files: omit(files, ['coverLetter']),