fix: update transaction search to handle missing transactions and improve date display

This commit is contained in:
void-57 2025-12-03 16:18:49 +05:30
parent 282422bbf7
commit ce3d3bcfea

View File

@ -659,7 +659,7 @@ async function searchTransactions(page = 1) {
try {
const tx = await cardanoAPI.getTransaction(query);
if (!tx || tx.error) {
if (!tx) {
txList.innerHTML = '<div class="no-transactions">Transaction not found.</div>';
return;
}
@ -671,7 +671,7 @@ async function searchTransactions(page = 1) {
const statusIcon = status === 'confirmed' ? 'fa-check-circle' :
status === 'pending' ? 'fa-clock' : 'fa-exclamation-circle';
const date = tx.timestamp ? new Date(typeof tx.timestamp === 'string' ? tx.timestamp : tx.timestamp * 1000).toLocaleString() : 'Unknown Date';
const date = tx.timestamp ? new Date(typeof tx.timestamp === 'string' ? tx.timestamp : tx.timestamp * 1000).toLocaleString() : 'Pending...';
const fees = tx.fees ? (Number(tx.fees) / 1000000).toFixed(6) : 'N/A';
// Calculate amounts