fix double websocket and wait for websocket to open to send paring tx

This commit is contained in:
AnisHADJARAB 2024-10-17 12:31:12 +00:00
parent cfed50a226
commit 3573b0d415
2 changed files with 4 additions and 3 deletions

View File

@ -36,8 +36,8 @@ document.querySelectorAll('.tab').forEach(tab => {
notifications.style.display = notifications?.style.display === 'none' ? 'block' : 'none' notifications.style.display = notifications?.style.display === 'none' ? 'block' : 'none'
} }
const service = await Services.getInstance() // const service = await Services.getInstance()
service.setNotification() // service.setNotification()
window.toggleMenu = toggleMenu; window.toggleMenu = toggleMenu;
window.openModal = openModal; window.openModal = openModal;
@ -73,6 +73,7 @@ docReady(function () {
if (spAddress) { if (spAddress) {
html5QrcodeScanner.clear(); html5QrcodeScanner.clear();
const service = await Services.getInstance()
// Call the sendPairingTx function with the extracted sp_address // Call the sendPairingTx function with the extracted sp_address
await service.sendPairingTx(spAddress); await service.sendPairingTx(spAddress);
} else { } else {

View File

@ -22,7 +22,7 @@ document.addEventListener('DOMContentLoaded', async () => {
const pairingAddress = urlParams.get('sp_address') const pairingAddress = urlParams.get('sp_address')
if(pairingAddress) { if(pairingAddress) {
await services.sendPairingTx(pairingAddress) setTimeout(async () => await services.sendPairingTx(pairingAddress), 1000)
} }
} }
}, 500); }, 500);