From 692f2055255e7fa43d0ce2fe6c88e964169c27fa Mon Sep 17 00:00:00 2001 From: Brian Clifton Date: Mon, 22 Jan 2018 11:12:57 -0700 Subject: [PATCH] Merge pull request #12769 from NejcZdovc/hotfix/#12217-contribution Fixes contribution pdf when having media publishers in --- js/about/contributionStatement.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/js/about/contributionStatement.js b/js/about/contributionStatement.js index b09efc2105a..f74153cd0ff 100644 --- a/js/about/contributionStatement.js +++ b/js/about/contributionStatement.js @@ -324,12 +324,13 @@ class ContributionStatement extends React.Component { { page.map(function (row, idx) { - let publisherSynopsis = (this.synopsis.filter((entry) => { return entry.site === row[0] }) || [])[0] || {} + const publisherKey = row[0] + const publisherSynopsis = (this.synopsis.filter((entry) => { return entry.publisherKey === publisherKey }) || [])[0] || {} - let verified = publisherSynopsis.verified - let site = row[0] - let fractionStr = (parseFloat(row[2]) * 100).toFixed(2) - let fiatStr = row[3] + const verified = publisherSynopsis && publisherSynopsis.verified + const fractionStr = (parseFloat(row[2]) * 100).toFixed(2) + const fiatStr = row[3] + const title = (publisherSynopsis && publisherSynopsis.siteName) ? publisherSynopsis.siteName : publisherKey return ( @@ -340,7 +341,7 @@ class ContributionStatement extends React.Component { styles.table__siteColumn)} data-test-id='siteColumnTr'> {verified ? : null} - {site} + {title} {fractionStr} {fiatStr}