aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorbitpshr <mail@bitpshr.net>2018-11-03 19:06:11 +0800
committerDan Finlay <542863+danfinlay@users.noreply.github.com>2018-11-06 07:07:09 +0800
commit9984f7edebb0de4432e152a7c6f0d93bb00b9da6 (patch)
tree6d31cfa892c348943138c3408ec4999914214284 /app
parentf557d3371892ae7625528aa5168549c57cfd740e (diff)
downloadtangerine-wallet-browser-9984f7edebb0de4432e152a7c6f0d93bb00b9da6.tar
tangerine-wallet-browser-9984f7edebb0de4432e152a7c6f0d93bb00b9da6.tar.gz
tangerine-wallet-browser-9984f7edebb0de4432e152a7c6f0d93bb00b9da6.tar.bz2
tangerine-wallet-browser-9984f7edebb0de4432e152a7c6f0d93bb00b9da6.tar.lz
tangerine-wallet-browser-9984f7edebb0de4432e152a7c6f0d93bb00b9da6.tar.xz
tangerine-wallet-browser-9984f7edebb0de4432e152a7c6f0d93bb00b9da6.tar.zst
tangerine-wallet-browser-9984f7edebb0de4432e152a7c6f0d93bb00b9da6.zip
Mark origins as unapproved if user explicitly locks MetaMask
Diffstat (limited to 'app')
-rw-r--r--app/scripts/controllers/provider-approval.js6
-rw-r--r--app/scripts/inpage.js2
2 files changed, 5 insertions, 3 deletions
diff --git a/app/scripts/controllers/provider-approval.js b/app/scripts/controllers/provider-approval.js
index 003f221ac..10b971a73 100644
--- a/app/scripts/controllers/provider-approval.js
+++ b/app/scripts/controllers/provider-approval.js
@@ -49,7 +49,8 @@ class ProviderApprovalController {
*/
_handleProviderRequest (origin) {
this.store.updateState({ providerRequests: [{ origin }] })
- if (this.isApproved(origin) && this.caching) {
+ const isUnlocked = this.keyringController.memStore.getState().isUnlocked
+ if (this.isApproved(origin) && this.caching && isUnlocked) {
this.approveProviderRequest(origin)
return
}
@@ -128,8 +129,9 @@ class ProviderApprovalController {
* @returns {boolean} - True if the origin has been approved
*/
isApproved (origin) {
+ const isUnlocked = this.keyringController.memStore.getState().isUnlocked
const privacyMode = this.preferencesController.getFeatureFlags().privacyMode
- return !privacyMode || this.approvedOrigins[origin]
+ return !privacyMode || (isUnlocked && this.approvedOrigins[origin])
}
/**
diff --git a/app/scripts/inpage.js b/app/scripts/inpage.js
index 794f15a0b..2ca3abde2 100644
--- a/app/scripts/inpage.js
+++ b/app/scripts/inpage.js
@@ -65,7 +65,7 @@ inpageProvider.enable = function () {
})
})
- // wait for the background to update with an accoount
+ // wait for the background to update with an account
const ethAccounts = new Promise((resolveAccounts, rejectAccounts) => {
inpageProvider.sendAsync({ method: 'eth_accounts', params: [] }, (error, response) => {
if (error) {