fix: Home's list drops the previous network's rows after a network switch (closes #718)
A network switch left the previous network's rows or failure message in Home's list until the new network's answer landed. Home now replaces them with "Loading..." when it first draws on a new network. A redraw on the same network keeps its rows. Home, AddressDetail and AddressToken compared the page's network before reading storage. A switch made in Settings could change the page during that read, and the answer was still drawn. They now compare after the read, for an answer and for a failure. Model: opus-5-5
This commit is contained in:
@@ -146,11 +146,12 @@ async function loadTransactions(address) {
|
||||
}
|
||||
|
||||
// If the network changed during the lookups above, or the screen now
|
||||
// shows another address, nothing is saved or drawn. See
|
||||
// src/shared/storedSettings.js.
|
||||
// shows another address, nothing is saved or drawn. The page's network
|
||||
// is compared after the read of storage, because a switch made on this
|
||||
// page can land during that read. See src/shared/storedSettings.js.
|
||||
if (
|
||||
state.networkId !== networkId ||
|
||||
!(await storedNetworkIs(networkId)) ||
|
||||
state.networkId !== networkId ||
|
||||
$("address-line").dataset.full !== address
|
||||
) {
|
||||
return;
|
||||
@@ -187,8 +188,8 @@ async function loadTransactions(address) {
|
||||
// If the network changed, or the screen now shows another address,
|
||||
// the failure is not shown.
|
||||
if (
|
||||
state.networkId !== networkId ||
|
||||
!(await storedNetworkIs(networkId)) ||
|
||||
state.networkId !== networkId ||
|
||||
$("address-line").dataset.full !== address
|
||||
) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user