Show tx status screens after dApp transaction approval
All checks were successful
check / check (push) Successful in 17s

Previously the approval popup closed immediately after the user
entered their password, giving zero feedback about whether the
transaction was broadcast or confirmed. Now:

1. Background sends the broadcast result back to the popup via
   sendResponse callback (txHash or error)
2. Popup shows wait-tx screen on success (with polling timer)
   or error-tx screen on failure
3. Wait-tx polls for confirmation and transitions to success-tx
4. Done button closes the approval window

txStatus.init() moved before the approval early-return so the
wait/success/error views are wired up in the approval popup.
Done buttons detect the approval context and call window.close()
instead of navigating to address detail.
This commit is contained in:
2026-02-27 12:50:24 +07:00
parent 1ebc206201
commit 54e6f6c180
4 changed files with 74 additions and 13 deletions

View File

@@ -169,8 +169,9 @@ async function init() {
await saveState();
}
// Always init approval — it may run in its own popup window
// Always init approval and txStatus — they may run in the approval popup window
approval.init(ctx);
txStatus.init(ctx);
// Check for approval mode
const params = new URLSearchParams(window.location.search);
@@ -202,7 +203,6 @@ async function init() {
addressToken.init(ctx);
send.init(ctx);
confirmTx.init(ctx);
txStatus.init(ctx);
transactionDetail.init(ctx);
receive.init(ctx);
addToken.init(ctx);