Move ERC-20 warning from address-token view to receive/QR view
All checks were successful
check / check (push) Successful in 17s

The warning about only sending ERC-20 tokens on the Ethereum network
belongs on the receive page where the QR code is shown, not on the
token detail view. Non-token receive flows hide the warning.
This commit is contained in:
2026-02-27 11:37:18 +07:00
parent 21fe854fa4
commit a1b181a471
4 changed files with 19 additions and 18 deletions

View File

@@ -366,12 +366,6 @@
</button>
</div>
<!-- ERC-20 warning -->
<div
id="address-token-erc20-warning"
class="text-xs border border-border border-dashed p-2 mb-3 hidden"
></div>
<!-- token-filtered transactions -->
<div class="mt-3">
<div class="border-b border-border pb-1 mb-1">
@@ -549,6 +543,10 @@
>
Copy address
</button>
<div
id="receive-erc20-warning"
class="text-xs border border-border border-dashed p-2 mt-3 hidden"
></div>
</div>
<!-- ============ ADD TOKEN ============ -->

View File

@@ -325,6 +325,7 @@ function init(_ctx) {
color: { dark: "#000000", light: "#ffffff" },
});
}
$("receive-erc20-warning").classList.add("hidden");
showView("receive");
});

View File

@@ -78,6 +78,7 @@ function timeAgo(timestamp) {
let loadedTxs = [];
let ensNameMap = new Map();
let currentSymbol = null;
function show() {
const wallet = state.wallets[state.selectedWallet];
@@ -100,6 +101,8 @@ function show() {
price = getPrice(symbol);
}
currentSymbol = symbol;
$("address-token-title").textContent =
wallet.name + " \u2014 Address " + (ai + 1) + " \u2014 " + symbol;
@@ -129,18 +132,6 @@ function show() {
// Single token balance line (no tokenId — not clickable here)
$("address-token-balance").innerHTML = balanceLine(symbol, amount, price);
// ERC-20 warning
const warningEl = $("address-token-erc20-warning");
if (tokenId !== "ETH") {
warningEl.textContent =
"This is an ERC-20 token. Only send " +
symbol +
" on the Ethereum network to this address. Sending tokens on other networks will result in permanent loss.";
warningEl.classList.remove("hidden");
} else {
warningEl.classList.add("hidden");
}
// Transactions
$("address-token-tx-list").innerHTML =
'<div class="text-muted text-xs py-1">Loading...</div>';
@@ -363,6 +354,16 @@ function init(ctx) {
color: { dark: "#000000", light: "#ffffff" },
});
}
const warningEl = $("receive-erc20-warning");
if (state.selectedToken && state.selectedToken !== "ETH") {
warningEl.textContent =
"This is an ERC-20 token. Only send " +
currentSymbol +
" on the Ethereum network to this address. Sending tokens on other networks will result in permanent loss.";
warningEl.classList.remove("hidden");
} else {
warningEl.classList.add("hidden");
}
showView("receive");
});
}

View File

@@ -424,6 +424,7 @@ function init(ctx) {
color: { dark: "#000000", light: "#ffffff" },
});
}
$("receive-erc20-warning").classList.add("hidden");
showView("receive");
});
}