persist confirm-tx view across popup close/reopen (closes #77)
All checks were successful
check / check (push) Successful in 23s

Add confirm-tx to RESTORABLE_VIEWS and save pendingTx in
state.viewData so the confirmation screen survives the popup
lifecycle. On restore, re-render the full confirmation view
including gas estimate.
This commit is contained in:
user
2026-02-28 12:19:39 -08:00
committed by Jeffrey Paul
parent 6a214f1c58
commit 78f961f416
2 changed files with 17 additions and 1 deletions

View File

@@ -39,6 +39,13 @@ const EXT_ICON =
let pendingTx = null;
function restore() {
const d = state.viewData;
if (d && d.pendingTx) {
show(d.pendingTx);
}
}
function etherscanTokenLink(address) {
return `https://etherscan.io/token/${address}`;
}
@@ -229,6 +236,7 @@ function show(txInfo) {
// Gas estimate — show placeholder then fetch async
$("confirm-fee").classList.remove("hidden");
$("confirm-fee-amount").textContent = "Estimating...";
state.viewData = { pendingTx: txInfo };
showView("confirm-tx");
estimateGas(txInfo);
@@ -359,4 +367,4 @@ function init(ctx) {
});
}
module.exports = { init, show };
module.exports = { init, show, restore };