From 436fe222967b16265fb6d2f4d7724f7a438d366b Mon Sep 17 00:00:00 2001 From: user Date: Sat, 28 Feb 2026 10:25:34 -0800 Subject: [PATCH] fix: call loadCalldata from render() so tx decoding persists across popup close/reopen Previously loadCalldata was only called from show(), meaning when the popup was closed and reopened (triggering render() directly via restoreView), the calldata decoding section was hidden and never re-fetched. Now render() triggers loadCalldata for contract calls, so decoded data always appears. Closes #60 --- src/popup/views/transactionDetail.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/popup/views/transactionDetail.js b/src/popup/views/transactionDetail.js index 1091005..6a94df3 100644 --- a/src/popup/views/transactionDetail.js +++ b/src/popup/views/transactionDetail.js @@ -93,9 +93,6 @@ function show(tx) { }, }; render(); - if (tx.isContractCall || tx.direction === "contract") { - loadCalldata(tx.hash, tx.to); - } } function render() { @@ -144,10 +141,14 @@ function render() { if (headingEl) headingEl.textContent = "Transaction"; } - // Hide calldata section by default; loadCalldata will show it if needed + // Hide calldata section; re-fetch if this is a contract call const calldataSection = $("tx-detail-calldata-section"); if (calldataSection) calldataSection.classList.add("hidden"); + if (tx.isContractCall || tx.direction === "contract") { + loadCalldata(tx.hash, tx.to); + } + $("tx-detail-time").textContent = isoDate(tx.timestamp) + " (" + timeAgo(tx.timestamp) + ")"; $("tx-detail-status").textContent = tx.isError ? "Failed" : "Success";