Skip to content

Commit c6e7633

Browse files
authored
chore: cancel connection attempt when removing connection, update assert to expect in webview and connection controller tests (#667)
1 parent b2e6cb2 commit c6e7633

File tree

3 files changed

+400
-559
lines changed

3 files changed

+400
-559
lines changed

src/connectionController.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -618,6 +618,13 @@ export default class ConnectionController {
618618
}
619619

620620
async removeSavedConnection(connectionId: string): Promise<void> {
621+
if (
622+
this._connectionAttempt &&
623+
connectionId === this._connectingConnectionId
624+
) {
625+
this.cancelConnectionAttempt();
626+
}
627+
621628
delete this._connections[connectionId];
622629

623630
await this._connectionStorage.removeConnection(connectionId);

0 commit comments

Comments
 (0)