fix: a double click on a Top tokens button tracks the token once (closes #729)
A "Top tokens:" button had no already-tracked check and stays enabled until its save ends, so a fast double click tracked the token twice in memory. Its handler now checks first. A second click shows "Already tracked." and tracks nothing. The top 100 dropdown already has this check, so it is unchanged. Model: opus-5-5
This commit was merged in pull request #731.
This commit is contained in:
@@ -45,6 +45,11 @@ function renderTop10() {
|
||||
el.querySelectorAll(".settings-addtoken-quick:not([disabled])").forEach(
|
||||
(btn) => {
|
||||
btn.addEventListener("click", async () => {
|
||||
// The button stays enabled until the first click's save ends.
|
||||
if (isTracked(btn.dataset.address)) {
|
||||
showFlash("Already tracked.");
|
||||
return;
|
||||
}
|
||||
const token = {
|
||||
address: btn.dataset.address,
|
||||
symbol: btn.dataset.symbol,
|
||||
|
||||
Reference in New Issue
Block a user