fix: the address screen shows a token just added at its fetched balance, not 0.0000 (closes #516)
A balance refresh that returns now draws the balances on AddressDetail or AddressToken again when that screen is up, not only the wallet list; their transaction lists are left alone. A token added on AddToken reads `quantity unknown` instead of 0.0000 until a refresh that started with it tracked has fetched every address's token balances. To tell an address whose token balances the explorer did not return, the refresh takes them off its copy of the wallets before fetching. Model: opus-5-5
This commit is contained in:
@@ -1396,7 +1396,8 @@ lists, the send-screen token selector, the address total and the remove-address
|
||||
warning (`isBelowOneMillionth()` in `src/shared/amountDisplay.js`). The Send and
|
||||
confirmation screens show it when its token is the one being sent. Tracked
|
||||
tokens with a zero balance are listed as well while "Show tracked tokens with
|
||||
zero balance" is on.
|
||||
zero balance" is on; a token just added on AddToken whose balance no refresh has
|
||||
fetched yet is listed there as `quantity unknown` (see AddToken).
|
||||
|
||||
#### Stored state and its version
|
||||
|
||||
@@ -1567,6 +1568,13 @@ such as an edit typed into Settings and not yet saved. Home is the one screen
|
||||
"Back" always re-renders, so the wallet list reflects anything that changed
|
||||
while the user was away from it.
|
||||
|
||||
The popup refreshes balances every ten seconds while it is open
|
||||
(`doRefreshAndRender()` in `src/popup/index.js`). Each refresh that returns
|
||||
draws the wallet list again and, when AddressDetail or AddressToken is up, that
|
||||
screen's USD total and balance lines; its transaction list is left alone. No
|
||||
other screen is drawn again by a refresh, since the rest show no balances or
|
||||
hold what the user typed.
|
||||
|
||||
A network switch leaves every screen on the page showing the previous network.
|
||||
The user makes it in Settings, or approves a site's request and the background
|
||||
saves it. Any other popup open meanwhile takes the switch from the stored
|
||||
@@ -2078,7 +2086,13 @@ view would leave a wallet one click from deletion.
|
||||
- "Add" button
|
||||
- **Transitions**:
|
||||
- "Add" (valid contract) → tracks the token, pops the stack, and re-renders
|
||||
**AddressDetail**
|
||||
**AddressDetail**. The token's balance is not known until a balance
|
||||
refresh that started with it tracked has fetched every address's token
|
||||
balances; until then its balance line reads `quantity unknown`, never
|
||||
`0.0000`, unless the explorer had already listed a holding of it. A
|
||||
refresh that returns draws AddressDetail's balances again (see
|
||||
Navigation), so the fetched balance shows without the screen being
|
||||
reopened
|
||||
- "Add" with a token already tracked, a scam-listed address, or a failed
|
||||
contract lookup → flash message, no screen change
|
||||
- "Add", then a network switch in Settings before the contract lookup
|
||||
|
||||
Reference in New Issue
Block a user