mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Merge pull request #6671 from MetaMask/bugfix/enable-rejection
bugfix: reject enable promise on user rejection
This commit is contained in:
commit
b600a4fa5c
@ -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