From e8f6dff0be27a3cd66c855ff8a9d1994c796dbb0 Mon Sep 17 00:00:00 2001 From: bitpshr Date: Fri, 31 May 2019 16:07:58 -0400 Subject: [PATCH] bugfix: reject enable promise on user rejection --- app/scripts/inpage.js | 4 ++-- 1 file 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) }