Merge pull request #6671 from MetaMask/bugfix/enable-rejection

bugfix: reject enable promise on user rejection
feature/default_network_editable
Dan Finlay 6 years ago committed by GitHub
commit b600a4fa5c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      app/scripts/inpage.js

@ -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)
}

Loading…
Cancel
Save