Skip to content

Commit a440158

Browse files
fix: add device connection cancellation (#106)
Fixed an issue where pressing the connect button again did not cancel the connection process. The `selectToConnect` method now correctly handles connection cancellation by resetting the connection target if it is already set. Closes #104 Co-authored-by: Tomás Grüner <[email protected]>
1 parent d2df6c9 commit a440158

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/types/devices/device.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,10 @@ export abstract class Device extends Sprite {
179179
}
180180

181181
selectToConnect() {
182+
if (Device.connectionTarget) {
183+
Device.connectionTarget = null;
184+
return;
185+
}
182186
Device.connectionTarget = this;
183187
}
184188

0 commit comments

Comments
 (0)