fix: a tracked token reads quantity unknown at an address no refresh has read (closes #720)
A new address, a new wallet and a network switch each leave tracked tokens with no balance entry, so their lines read 0.0000 before any refresh had read them. Each of these now sets `balanceNotFetched` on the tracked tokens, and a refresh already clears it. Their lines read `quantity unknown` until then. Addresses that the wallet scan finds get the same. A refresh that did not read every address the page now holds leaves the field set. Model: opus-5-5
This commit is contained in:
@@ -7,6 +7,7 @@ const {
|
||||
goBack,
|
||||
clearViewStack,
|
||||
onViewLeave,
|
||||
markTrackedTokensNotFetched,
|
||||
} = require("./helpers");
|
||||
const {
|
||||
generateMnemonic,
|
||||
@@ -195,6 +196,7 @@ async function importMnemonic(ctx) {
|
||||
],
|
||||
};
|
||||
state.wallets.push(wallet);
|
||||
markTrackedTokensNotFetched();
|
||||
state.hasWallet = true;
|
||||
if (state.activeAddress === null) {
|
||||
state.activeAddress = firstAddress;
|
||||
@@ -220,6 +222,7 @@ async function importMnemonic(ctx) {
|
||||
tokenBalances: [],
|
||||
}));
|
||||
wallet.nextIndex = scan.nextIndex;
|
||||
markTrackedTokensNotFetched();
|
||||
// The new list leaves out the first address when the scan found it
|
||||
// unused. If it was the active one, the new list's first takes over,
|
||||
// and the background is told as when the user picks one on Home.
|
||||
@@ -266,6 +269,7 @@ async function importPrivateKey(ctx) {
|
||||
encryptedSecret: encrypted,
|
||||
addresses: [{ address: addr, balance: "0.0000", tokenBalances: [] }],
|
||||
});
|
||||
markTrackedTokensNotFetched();
|
||||
state.hasWallet = true;
|
||||
if (state.activeAddress === null) {
|
||||
state.activeAddress = addr;
|
||||
@@ -330,6 +334,7 @@ async function importXprvKey(ctx) {
|
||||
],
|
||||
};
|
||||
state.wallets.push(wallet);
|
||||
markTrackedTokensNotFetched();
|
||||
state.hasWallet = true;
|
||||
if (state.activeAddress === null) {
|
||||
state.activeAddress = firstAddress;
|
||||
@@ -355,6 +360,7 @@ async function importXprvKey(ctx) {
|
||||
tokenBalances: [],
|
||||
}));
|
||||
wallet.nextIndex = scan.nextIndex;
|
||||
markTrackedTokensNotFetched();
|
||||
// As for a recovery phrase: an active first address the scan left
|
||||
// out gives way to the new list's first.
|
||||
const activeMoved =
|
||||
|
||||
Reference in New Issue
Block a user