fix: tracked tokens are kept per network, and bundled picks are offered on mainnet only (closes #523)
A network switch now 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, the way endpoints are kept per network. trackedTokens stays the active network's list, so its readers are unchanged, and the background's switch goes through the same function. The two add-token screens offer their common-token picks, which are mainnet contracts, on Ethereum Mainnet only. After a switch in Settings, Back finds the screens beneath as a reopened popup does: it renders the one it lands on for the new network, and the stack is cut at the first screen that cannot be rendered from saved state. Model: opus-5-5
This commit is contained in:
@@ -37,9 +37,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();
|
||||
}
|
||||
@@ -213,9 +215,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