diff --git a/src/popup/index.html b/src/popup/index.html index c94e801..b3422e2 100644 --- a/src/popup/index.html +++ b/src/popup/index.html @@ -366,12 +366,6 @@ - - -
@@ -549,6 +543,10 @@ > Copy address +
diff --git a/src/popup/views/addressDetail.js b/src/popup/views/addressDetail.js index a7d16cc..406e12f 100644 --- a/src/popup/views/addressDetail.js +++ b/src/popup/views/addressDetail.js @@ -325,6 +325,7 @@ function init(_ctx) { color: { dark: "#000000", light: "#ffffff" }, }); } + $("receive-erc20-warning").classList.add("hidden"); showView("receive"); }); diff --git a/src/popup/views/addressToken.js b/src/popup/views/addressToken.js index a9c9999..cd1ef75 100644 --- a/src/popup/views/addressToken.js +++ b/src/popup/views/addressToken.js @@ -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 = '
Loading...
'; @@ -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"); }); } diff --git a/src/popup/views/home.js b/src/popup/views/home.js index c97b569..fb8fe87 100644 --- a/src/popup/views/home.js +++ b/src/popup/views/home.js @@ -424,6 +424,7 @@ function init(ctx) { color: { dark: "#000000", light: "#ffffff" }, }); } + $("receive-erc20-warning").classList.add("hidden"); showView("receive"); }); }