Skip to content

Commit

Permalink
Merge pull request #6671 from MetaMask/bugfix/enable-rejection
Browse files Browse the repository at this point in the history
bugfix: reject enable promise on user rejection
  • Loading branch information
danfinlay authored May 31, 2019
2 parents d837703 + e8f6dff commit b600a4f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/scripts/inpage.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ inpageProvider.setMaxListeners(100)
inpageProvider.enable = function ({ force } = {}) {
return new Promise((resolve, reject) => {
inpageProvider.sendAsync({ method: 'eth_requestAccounts', params: [force] }, (error, response) => {
if (error) {
reject(error)
if (error || response.error) {
reject(error || response.error)
} else {
resolve(response.result)
}
Expand Down

0 comments on commit b600a4f

Please sign in to comment.