Pair device when receiving both confirmations

This commit is contained in:
NicolasCantu 2025-01-03 13:12:29 +01:00
parent 933f8398dd
commit 76baca6e30
2 changed files with 8 additions and 7 deletions

View File

@ -179,6 +179,7 @@ export default class ModalService {
} }
console.log("Device 2 is ready - Device 1 can now proceed"); console.log("Device 2 is ready - Device 1 can now proceed");
} }
service.pairDevice(this.paired_addresses, this.processId);
this.paired_addresses = []; this.paired_addresses = [];
this.processId = null; this.processId = null;
this.stateId = null; this.stateId = null;
@ -219,6 +220,8 @@ export default class ModalService {
} catch (e) { } catch (e) {
throw e; throw e;
} }
service.pairDevice(this.paired_addresses, this.processId!);
this.paired_addresses = []; this.paired_addresses = [];
this.processId = null; this.processId = null;

View File

@ -524,13 +524,11 @@ export default class Services {
} }
} }
pairDevice(spAddressList: string[]) { pairDevice(spAddressList: string[], pairingProcess: string) {
if (this.currentProcess) { try {
try { this.sdkClient.pair_device(pairingProcess, spAddressList);
this.sdkClient.pair_device(this.currentProcess, spAddressList); } catch (e) {
} catch (e) { throw new Error(`Failed to pair device: ${e}`);
throw new Error(`Failed to pair device: ${e}`);
}
} }
} }