Skip to content

Commit 917aa33

Browse files
committed
Ensure interval is cleared when transport is cleared up
1 parent 62bae55 commit 917aa33

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

bundle.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,9 @@ var LedgerBridge = function () {
262262
await this.transport.close();
263263
this.transport = null;
264264
}
265+
if (this.pollingInterval) {
266+
clearInterval(this.pollingInterval);
267+
}
265268
if (replyAction) {
266269
this.sendMessageToExtension({
267270
action: replyAction,
@@ -380,9 +383,6 @@ var LedgerBridge = function () {
380383
key: 'onDisconnect',
381384
value: function onDisconnect() {
382385
this.cleanUp();
383-
if (this.pollingInterval) {
384-
clearInterval(this.pollingInterval);
385-
}
386386
this.sendConnectionMessage(false);
387387
}
388388
}, {

ledger-bridge.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,9 @@ export default class LedgerBridge {
214214
await this.transport.close()
215215
this.transport = null
216216
}
217+
if (this.pollingInterval) {
218+
clearInterval(this.pollingInterval)
219+
}
217220
if (replyAction) {
218221
this.sendMessageToExtension({
219222
action: replyAction,
@@ -331,9 +334,6 @@ export default class LedgerBridge {
331334

332335
onDisconnect() {
333336
this.cleanUp()
334-
if (this.pollingInterval) {
335-
clearInterval(this.pollingInterval)
336-
}
337337
this.sendConnectionMessage(false)
338338
}
339339

0 commit comments

Comments
 (0)