Skip to content

Commit

Permalink
Ensure interval is cleared when transport is cleared up
Browse files Browse the repository at this point in the history
  • Loading branch information
darkwing committed Jun 9, 2022
1 parent 62bae55 commit 917aa33
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,9 @@ var LedgerBridge = function () {
await this.transport.close();
this.transport = null;
}
if (this.pollingInterval) {
clearInterval(this.pollingInterval);
}
if (replyAction) {
this.sendMessageToExtension({
action: replyAction,
Expand Down Expand Up @@ -380,9 +383,6 @@ var LedgerBridge = function () {
key: 'onDisconnect',
value: function onDisconnect() {
this.cleanUp();
if (this.pollingInterval) {
clearInterval(this.pollingInterval);
}
this.sendConnectionMessage(false);
}
}, {
Expand Down
6 changes: 3 additions & 3 deletions ledger-bridge.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,9 @@ export default class LedgerBridge {
await this.transport.close()
this.transport = null
}
if (this.pollingInterval) {
clearInterval(this.pollingInterval)
}
if (replyAction) {
this.sendMessageToExtension({
action: replyAction,
Expand Down Expand Up @@ -331,9 +334,6 @@ export default class LedgerBridge {

onDisconnect() {
this.cleanUp()
if (this.pollingInterval) {
clearInterval(this.pollingInterval)
}
this.sendConnectionMessage(false)
}

Expand Down

0 comments on commit 917aa33

Please sign in to comment.