Skip to content

Commit

Permalink
fix(transit): when transit disconnect, always call transporter.discon…
Browse files Browse the repository at this point in the history
…nect()
  • Loading branch information
0x0a0d committed Nov 17, 2023
1 parent 6a58b17 commit 2040693
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/transit.js
Original file line number Diff line number Diff line change
Expand Up @@ -231,10 +231,9 @@ class Transit {

return this.Promise.resolve()
.then(() => {
if (this.tx.connected) {
return this.discoverer.localNodeDisconnected().then(() => this.tx.disconnect());
}
return this.tx.connected && this.discoverer.localNodeDisconnected();
})
.then(() => this.tx.disconnect())
.then(() => (this.disconnecting = false));
}

Expand Down

0 comments on commit 2040693

Please sign in to comment.