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

@@ -607,10 +607,13 @@ runtime.onMessage.addListener((msg, sender, sendResponse) => {
const connected = signer.connect(provider);
const tx = await connected.sendTransaction(approval.txParams);
approval.resolve({ txHash: tx.hash });
sendResponse({ txHash: tx.hash });
} catch (e) {
const errMsg = e.shortMessage || e.message;
approval.resolve({
error: { message: e.shortMessage || e.message },
error: { message: errMsg },
});
sendResponse({ error: errMsg });
}
})();
return true;