@metamask/eth-ledger-bridge-keyring 0.11.0 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/index.js +6 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.12.0]
|
|
11
|
+
### Added
|
|
12
|
+
- Add a new `destroy` method which will remove the `message` event listener from window. ([#145](https://github.com/MetaMask/eth-ledger-bridge-keyring/pull/145))
|
|
13
|
+
|
|
10
14
|
## [0.11.0]
|
|
11
15
|
### Added
|
|
12
16
|
- Add a new `isConnected` method which allows determining if the device is last known to be connected. ([#131](https://github.com/MetaMask/eth-ledger-bridge-keyring/pull/131))
|
package/index.js
CHANGED
|
@@ -486,7 +486,7 @@ class LedgerBridgeKeyring extends EventEmitter {
|
|
|
486
486
|
}
|
|
487
487
|
|
|
488
488
|
_setupListener () {
|
|
489
|
-
|
|
489
|
+
this._eventListener = ({ origin, data }) => {
|
|
490
490
|
if (origin !== this._getOrigin()) {
|
|
491
491
|
return false
|
|
492
492
|
}
|
|
@@ -501,7 +501,11 @@ class LedgerBridgeKeyring extends EventEmitter {
|
|
|
501
501
|
|
|
502
502
|
return undefined
|
|
503
503
|
}
|
|
504
|
-
window.addEventListener('message',
|
|
504
|
+
window.addEventListener('message', this._eventListener)
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
destroy () {
|
|
508
|
+
window.removeEventListener('message', this._eventListener)
|
|
505
509
|
}
|
|
506
510
|
|
|
507
511
|
async __getPage (increment) {
|