Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Commit

Permalink
Fix call to Tabs.create when printing backup recovery keys
Browse files Browse the repository at this point in the history
Fix #6150

Auditors: @bsclifton

It was crashing because it was treating this api as a promise but really it uses callbacks.

Note that the print operation won't actually work until #6159 is addressed.
  • Loading branch information
bbondy committed Dec 12, 2016
1 parent baeacbc commit 492bc95
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions app/ledger.js
Original file line number Diff line number Diff line change
Expand Up @@ -266,14 +266,12 @@ var backupKeys = (appState, action) => {
if (err) {
console.log(err)
} else {
Tabs.create({url: fileUrl(filePath)}).then((webContents) => {
Tabs.create({url: fileUrl(filePath)}, (webContents) => {
if (action.backupAction === 'print') {
webContents.print({silent: false, printBackground: false})
} else {
webContents.downloadURL(fileUrl(filePath))
}
}).catch((err) => {
console.error(err)
})
}
})
Expand Down

1 comment on commit 492bc95

@bsclifton
Copy link
Member

@bsclifton bsclifton commented on 492bc95 Dec 12, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could keep the console.error() in there and add an onError callback? but otherwise ++ 😄

Please sign in to comment.