mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
bugfix: reject enable promise on user rejection
This commit is contained in:
parent
d837703546
commit
e8f6dff0be
@ -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…
Reference in New Issue
Block a user