From d04d93a0396c96e5156ed30090b96a34f5a71e88 Mon Sep 17 00:00:00 2001
From: Willy Bruns <willy@entropi.info>
Date: Fri, 16 Dec 2016 16:10:07 -0800
Subject: [PATCH 1/2] fix verified publisher icon in Contribution Statement PDF

for #6039
---
 js/about/contributionStatement.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/js/about/contributionStatement.js b/js/about/contributionStatement.js
index 88ec6b76050..18343a44edd 100644
--- a/js/about/contributionStatement.js
+++ b/js/about/contributionStatement.js
@@ -280,7 +280,7 @@ class ContributionStatement extends ImmutableComponent {
               <tr className='spacingRow' />
               {
               page.map(function (row, idx) {
-                let publisherSynopsis = this.synopsis[row.siteColumn] || {}
+                let publisherSynopsis = (this.synopsis.filter((entry) => { return entry.site === row[0] }) || [])[0] || {}
 
                 let verified = publisherSynopsis.verified
                 let site = row[0]

From 2c4afcf5e3e31d383f9cc9c53a7baf1df1029392 Mon Sep 17 00:00:00 2001
From: Willy Bruns <willy@entropi.info>
Date: Tue, 20 Dec 2016 17:20:20 -0800
Subject: [PATCH 2/2] open contribution PDF after saving

for issue #6039
(depends on #2714 , possibly fixed in #6330)
---
 app/pdf.js                        | 12 ++++++------
 js/about/aboutActions.js          |  5 +++--
 js/about/contributionStatement.js |  2 +-
 3 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/app/pdf.js b/app/pdf.js
index 76d26f4a296..314beda21ec 100644
--- a/app/pdf.js
+++ b/app/pdf.js
@@ -6,14 +6,14 @@
 
 const electron = require('electron')
 const BrowserWindow = electron.BrowserWindow
+const Tabs = require('./browser/tabs')
+const {fileUrl} = require('../js/lib/appUrlUtil')
 
 const renderUrlToPdf = (appState, action, testingMode) => {
   let url = action.url
   let savePath = action.savePath
   let openAfterwards = action.openAfterwards
 
-  let currentBw = BrowserWindow.getFocusedWindow()
-
   let bw = new BrowserWindow({show: !!testingMode, backgroundColor: '#ffffff'})
 
   let wv = bw.webContents
@@ -41,15 +41,15 @@ const renderUrlToPdf = (appState, action, testingMode) => {
           if (state === 'completed') {
             let finalSavePath = item && item.getSavePath()
 
-            if (openAfterwards && savePath) {
-              currentBw.webContents.loadURL('file://' + finalSavePath)
-            }
-
             if (bw && !testingMode) {
               try {
                 bw.close()
               } catch (exc) {}
             }
+
+            if (openAfterwards && finalSavePath) {
+              Tabs.create({url: fileUrl(finalSavePath)})
+            }
           }
         })
       })
diff --git a/js/about/aboutActions.js b/js/about/aboutActions.js
index 3dda621c60c..14cb50757fb 100644
--- a/js/about/aboutActions.js
+++ b/js/about/aboutActions.js
@@ -364,11 +364,12 @@ const aboutActions = {
   /**
    * Dispatches a message to render a URL into a PDF file
    */
-  renderUrlToPdf: function (url, savePath) {
+  renderUrlToPdf: function (url, savePath, openAfterwards) {
     aboutActions.dispatchAction({
       actionType: appConstants.APP_RENDER_URL_TO_PDF,
       url: url,
-      savePath: savePath
+      savePath: savePath,
+      openAfterwards: openAfterwards
     })
   }
 }
diff --git a/js/about/contributionStatement.js b/js/about/contributionStatement.js
index 18343a44edd..8a10af56dcf 100644
--- a/js/about/contributionStatement.js
+++ b/js/about/contributionStatement.js
@@ -127,7 +127,7 @@ class ContributionStatement extends ImmutableComponent {
   }
 
   renderPdf () {
-    aboutActions.renderUrlToPdf(this.htmlDataURL, this.receiptFileName())
+    aboutActions.renderUrlToPdf(this.htmlDataURL, this.receiptFileName(), true)
   }
 
   get transaction () {