Skip to content

Commit

Permalink
Dispose the trezor connect iframe upon lock (#13018)
Browse files Browse the repository at this point in the history
* Dispose the trezor connect iframe upon lock

* Use KEYRING_TYPES.TREZOR

* Update eth-trezor-keyring version
  • Loading branch information
danjm committed Dec 8, 2021
1 parent e7b11be commit a34f88e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
6 changes: 6 additions & 0 deletions app/scripts/metamask-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -3349,6 +3349,12 @@ export default class MetamaskController extends EventEmitter {
* Locks MetaMask
*/
setLocked() {
const [trezorKeyring] = this.keyringController.getKeyringsByType(
KEYRING_TYPES.TREZOR,
);
if (trezorKeyring) {
trezorKeyring.dispose();
}
return this.keyringController.setLocked();
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@
"eth-query": "^2.1.2",
"eth-rpc-errors": "^4.0.2",
"eth-sig-util": "^3.0.0",
"eth-trezor-keyring": "^0.8.0",
"eth-trezor-keyring": "^0.9.0",
"ethereum-ens-network-map": "^1.0.2",
"ethereumjs-abi": "^0.6.4",
"ethereumjs-util": "^7.0.10",
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11460,10 +11460,10 @@ eth-simple-keyring@^4.2.0:
ethereumjs-wallet "^1.0.1"
events "^1.1.1"

eth-trezor-keyring@^0.8.0:
version "0.8.0"
resolved "https://registry.yarnpkg.com/eth-trezor-keyring/-/eth-trezor-keyring-0.8.0.tgz#e0a40ab24954ba637946ce3848b15df6dd7a8bde"
integrity sha512-++u/9/OkQ+NkFcGDwhabpJkcYlCWQYcVLejWvDoKCNHNSjBUxa99tI9kg2wdf/ZoFKMOekbK6/WYlXJYCHMnrQ==
eth-trezor-keyring@^0.9.0:
version "0.9.0"
resolved "https://registry.yarnpkg.com/eth-trezor-keyring/-/eth-trezor-keyring-0.9.0.tgz#06b0f2f4c072651c0944a0dfbfa7b2b0c9987433"
integrity sha512-Rg9XUiYIOs7Ulz0ODc/udouM7276fCQhTnYhJC9OJTWrz6U5tAkdqnmTsZNMS2sdMWzuFhGz0+pQz9yTIryGQA==
dependencies:
"@ethereumjs/tx" "^3.2.1"
ethereumjs-util "^7.0.9"
Expand Down

0 comments on commit a34f88e

Please sign in to comment.