fix: tracked tokens are kept per network, and bundled picks are offered on mainnet only (closes #523)
A network switch puts the outgoing network's tracked tokens away in a new persisted field, networkTrackedTokens, and brings back the incoming network's list, or an empty one, as endpoints are kept; the background's switch uses the same function. The two add-token screens offer their common-token picks on Ethereum Mainnet only. After a switch in Settings, Back renders the screen it lands on again, and the stack is cut at the first screen that cannot be rendered from saved state, or at AddressToken for any token but the native one; the cut stack is saved with the switch. ConfirmTx drawn again keeps the network it was reviewed on. A contract lookup that answers after a switch adds nothing. Model: opus-5-5
This commit was merged in pull request #572.
This commit is contained in:
@@ -38,9 +38,11 @@ function markViewRendered(view) {
|
||||
if (view) renderedViews.add(view);
|
||||
}
|
||||
|
||||
// Begin a fresh page-load scope. The popup gets one by being loaded; the
|
||||
// Begin a fresh page-load scope. The popup gets one by being loaded, and
|
||||
// asks for one when the user switches the network, because every screen
|
||||
// then on the page shows the previous network (views/settings.js); the
|
||||
// unit tests, which simulate several page loads against one module
|
||||
// instance, ask for one.
|
||||
// instance, ask for one too.
|
||||
function resetRenderedViews() {
|
||||
renderedViews.clear();
|
||||
}
|
||||
@@ -217,9 +219,10 @@ function renderView(view, state, views) {
|
||||
// in the two cases where the view is known to be on the page already:
|
||||
//
|
||||
// - It is not one the popup renders from persisted state. The restored
|
||||
// stack is filtered against RESTORABLE_VIEWS, so such a view can only
|
||||
// be on the stack from this page load, where forward navigation
|
||||
// rendered it on the way in.
|
||||
// stack is filtered against RESTORABLE_VIEWS, and a network switch cuts
|
||||
// it the same way (views/settings.js), so such a view can only be on the
|
||||
// stack from this page load, where forward navigation rendered it on the
|
||||
// way in.
|
||||
// - This page load has rendered it. Re-rendering would re-fetch and
|
||||
// clobber what it holds; Home is rendered anyway, see above.
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user