fix confirm breaking and not going to process page
This commit is contained in:
parent
3573b0d415
commit
65bfe1cd21
@ -12,6 +12,7 @@ export default class Routing {
|
||||
private currentPrd: any;
|
||||
private currentOutpoint?: string;
|
||||
private constructor() {}
|
||||
private paired_addresses: string[] = [];
|
||||
|
||||
// Method to access the singleton instance of Services
|
||||
public static async getInstance(): Promise<Routing> {
|
||||
@ -51,9 +52,8 @@ export default class Routing {
|
||||
// We take all the addresses except our own
|
||||
const local_address = this.sdkClient.get_address();
|
||||
console.log("🚀 ~ Routing ~ openConfirmationModal ~ pcd:", pcd)
|
||||
let paired_addresses: string[] = [];
|
||||
for (const address of members[0]['sp_addresses']) {
|
||||
if (address !== local_address) { paired_addresses.push(address) }
|
||||
if (address !== local_address) { this.paired_addresses.push(address) }
|
||||
}
|
||||
let html = confirmationModalHtml;
|
||||
// html = html.replace('{{device1}}', members[0]['sp_addresses'][0]);
|
||||
@ -75,7 +75,7 @@ export default class Routing {
|
||||
window.onclick = (event) => {
|
||||
const modal = document.getElementById('modal');
|
||||
if (event.target === modal) {
|
||||
this.confirmPairing(paired_addresses);
|
||||
this.confirmPairing();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -90,7 +90,7 @@ export default class Routing {
|
||||
if (modal) modal.style.display = 'none';
|
||||
}
|
||||
|
||||
async confirmPairing(paired_addresses: string[]) {
|
||||
async confirmPairing() {
|
||||
const service = await Services.getInstance()
|
||||
const modal = document.getElementById('modal')
|
||||
// console.log("🚀 ~ Routing ~ confirm ~ prd:", prd)
|
||||
@ -100,7 +100,8 @@ export default class Routing {
|
||||
const commitmentOutpoint = `${emptyTxid}:${U32_MAX}`;
|
||||
|
||||
// We take the paired device(s) from the contract
|
||||
this.sdkClient.pair_device(commitmentOutpoint, paired_addresses)
|
||||
this.sdkClient.pair_device(commitmentOutpoint, this.paired_addresses)
|
||||
this.paired_addresses = []
|
||||
|
||||
service.injectProcessListPage();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user