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;
@ -220,6 +221,8 @@ export default class ModalService {
throw e; throw e;
} }
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;

View File

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