fix: a second click on Add while the lookup waits tracks the token once (closes #727)
check / check (push) Canceled after 0s
e2e / e2e-chrome (push) Canceled after 0s
e2e / e2e-firefox (push) Canceled after 0s

The "already tracked" check ran only before the contract lookup, so a second click while the first lookup waited tracked the token twice. AddToken and SettingsAddToken now check again when the lookup answers. An answer for a token tracked meanwhile shows the "already tracked" flash message and tracks nothing.

Model: opus-5-5
This commit was merged in pull request #728.
This commit is contained in:
2026-11-03 06:24:14 +01:00
parent 1a4fb0803d
commit 267b69382e
3 changed files with 109 additions and 9 deletions
+8
View File
@@ -163,6 +163,14 @@ function init(_ctx) {
);
return;
}
// Another click on Add, or a "Top tokens:" button, may have
// tracked this token while this lookup waited.
if (isTracked(addr)) {
showFlash("Already tracked.");
infoEl.textContent = "";
infoEl.style.visibility = "hidden";
return;
}
// The balance list never shows a token that the spoof rule
// refuses, so such a token is not tracked. The rule never refuses
// a bundled token, so the "Top tokens:" buttons and the top 100