persist confirm-tx view across popup close/reopen (closes #77) #79
Reference in New Issue
Block a user
Delete Branch "fix/issue-77-confirm-tx-persist"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The
confirm-txview was not inRESTORABLE_VIEWS, so closing and reopening the popup during transaction confirmation would lose the view and return tomain.Fix:
confirm-txtoRESTORABLE_VIEWSpendingTxdata instate.viewDatabefore showing the confirm viewrestore()function that re-renders from persistedviewDatarestoreView()switchOn popup reopen, the full confirmation screen (amounts, addresses, warnings, gas estimate) is re-rendered from persisted state.
docker build .passes.shouldnt gas estimate be re-calculated, given that it might be an hour later?
Review: ✅ merge-ready
Code review passed. Build passes.
Re: gas re-calculation concern
@sneak good question — the gas is re-estimated on popup reopen.
restore()callsshow(pendingTx), which sets the fee to "Estimating..." and callsestimateGas(txInfo)asynchronously. Only the transaction parameters (to, amount, token) are persisted; gas is always fresh.The PR description saying "re-rendered from persisted state" is slightly misleading — only the tx params are persisted, gas is recalculated live.
Changes summary
confirm-txadded toRESTORABLE_VIEWSpendingTxsaved tostate.viewDatainshow()restore()re-callsshow()(which re-estimates gas)Clean, minimal, correct. Ready to merge.
9f85758ef6to78f961f416