aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbitpshr <mail@bitpshr.net>2019-06-01 04:07:58 +0800
committerbitpshr <mail@bitpshr.net>2019-06-01 04:07:58 +0800
commite8f6dff0be27a3cd66c855ff8a9d1994c796dbb0 (patch)
tree42aebce52a0ed072015396f20effc4a5114e830a
parentd83770354636b8c4d933903d1e19bc9733f15a4c (diff)
downloadtangerine-wallet-browser-e8f6dff0be27a3cd66c855ff8a9d1994c796dbb0.tar
tangerine-wallet-browser-e8f6dff0be27a3cd66c855ff8a9d1994c796dbb0.tar.gz
tangerine-wallet-browser-e8f6dff0be27a3cd66c855ff8a9d1994c796dbb0.tar.bz2
tangerine-wallet-browser-e8f6dff0be27a3cd66c855ff8a9d1994c796dbb0.tar.lz
tangerine-wallet-browser-e8f6dff0be27a3cd66c855ff8a9d1994c796dbb0.tar.xz
tangerine-wallet-browser-e8f6dff0be27a3cd66c855ff8a9d1994c796dbb0.tar.zst
tangerine-wallet-browser-e8f6dff0be27a3cd66c855ff8a9d1994c796dbb0.zip
bugfix: reject enable promise on user rejection
-rw-r--r--app/scripts/inpage.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/scripts/inpage.js b/app/scripts/inpage.js
index a4fb552f1..fb16dd43d 100644
--- a/app/scripts/inpage.js
+++ b/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)
}