update: hopefully....

This commit is contained in:
nate 2026-03-19 00:49:32 +04:00
parent 7e55b2ad95
commit 8a24b30b2a
1 changed files with 6 additions and 3 deletions

View File

@ -257,7 +257,6 @@
watchedAddress = address;
watchedTxids = [];
// Raw SSE — no query filter at all
eventSource = new EventSource(`${SOCK_API}/sse`);
console.log('SSE: connected, watching for', address);
@ -289,7 +288,6 @@
<span class="w-2 h-2 rounded-full bg-blue-500 animate-pulse"></span>
<span class="text-blue-400">Transaction detected, waiting for confirmation...</span>
`;
pollStatus();
return;
}
}
@ -299,7 +297,12 @@
const blockTxs = event.data?.tx ?? [];
if (watchedTxids.some(t => blockTxs.includes(t))) {
console.log('SSE: block confirmed our tx');
pollStatus();
// Show confirmed immediately, poll will finalize with backend
clearInterval(countdownInterval);
if (eventSource) { eventSource.close(); eventSource = null; }
document.getElementById('pay-status-section').classList.add('hidden');
document.getElementById('pay-success').classList.remove('hidden');
setTimeout(() => { window.location.href = '/dashboard/settings'; }, 3000);
}
}