fix: Blockscout and Etherscan lookups are off until the user turns them on (closes #668)
Out of the box the wallet sent the user's addresses to Blockscout for history and token lookups. It sent each recipient to Etherscan for its label. Two settings, "Use Blockscout" and "Check recipients on Etherscan", now gate those requests where they are made. Both are off in a new install and offered unticked on Welcome and in Settings. While one is off, the screens that relied on it say so in a plain line naming the setting. Unticking "Use Blockscout" drops every untracked token from every address. After either changes in Settings, Back draws again any screen a reopened popup can draw. ENS lookups ask only the RPC endpoint. Model: opus-5-5
This commit is contained in:
@@ -1386,6 +1386,10 @@ const RECENT_BALANCE_REFRESH_MS = Math.floor(BALANCE_REFRESH_PERIOD_MS / 2);
|
||||
// back over them (https://git.eeqj.de/sneak/AutistMask/issues/577).
|
||||
// lastBalanceRefresh is left as the switch set it, so the next tick refreshes
|
||||
// the new network.
|
||||
//
|
||||
// Nothing is applied either when "Use Blockscout" stored NOW is not the one the
|
||||
// refresh ran with. Turning it off dropped the tokens the user has not tracked
|
||||
// (src/popup/views/settings.js), and this refresh must not bring them back.
|
||||
async function backgroundRefresh() {
|
||||
const s = await getState();
|
||||
const now = Date.now();
|
||||
@@ -1397,6 +1401,7 @@ async function backgroundRefresh() {
|
||||
wallets,
|
||||
s.rpcUrl,
|
||||
s.blockscoutUrl,
|
||||
s.useBlockscout,
|
||||
s.trackedTokens,
|
||||
s.networkId,
|
||||
);
|
||||
@@ -1410,6 +1415,7 @@ async function backgroundRefresh() {
|
||||
|
||||
await updateState((fresh) => {
|
||||
if (fresh.networkId !== s.networkId) return;
|
||||
if (fresh.useBlockscout !== s.useBlockscout) return;
|
||||
for (const wallet of fresh.wallets) {
|
||||
for (const addr of wallet.addresses || []) {
|
||||
const got = refreshed.get(String(addr.address).toLowerCase());
|
||||
|
||||
Reference in New Issue
Block a user