Skip to content

Commit 91abcb9

Browse files
AndrewAndrew
authored andcommitted
Avoid creating more than one session at any time for pairing
1 parent 7ee2dd6 commit 91abcb9

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/daemon.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,11 @@ export class DeviceDaemon extends EventEmitter {
508508
// ----------------------------------------------------------------
509509

510510
async _startPairing() {
511+
// Guard: don't create a second pairing session if one is already active
512+
if (this._state === 'pairing' && this._pairingWizard) {
513+
return;
514+
}
515+
511516
this._state = 'pairing';
512517

513518
this._pairingWizard = new PairingWizard({

0 commit comments

Comments
 (0)