Move ERC-20 warning from address-token view to receive/QR view
All checks were successful
check / check (push) Successful in 17s
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:
@@ -366,12 +366,6 @@
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</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 -->
|
<!-- token-filtered transactions -->
|
||||||
<div class="mt-3">
|
<div class="mt-3">
|
||||||
<div class="border-b border-border pb-1 mb-1">
|
<div class="border-b border-border pb-1 mb-1">
|
||||||
@@ -549,6 +543,10 @@
|
|||||||
>
|
>
|
||||||
Copy address
|
Copy address
|
||||||
</button>
|
</button>
|
||||||
|
<div
|
||||||
|
id="receive-erc20-warning"
|
||||||
|
class="text-xs border border-border border-dashed p-2 mt-3 hidden"
|
||||||
|
></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- ============ ADD TOKEN ============ -->
|
<!-- ============ ADD TOKEN ============ -->
|
||||||
|
|||||||
@@ -325,6 +325,7 @@ function init(_ctx) {
|
|||||||
color: { dark: "#000000", light: "#ffffff" },
|
color: { dark: "#000000", light: "#ffffff" },
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
$("receive-erc20-warning").classList.add("hidden");
|
||||||
showView("receive");
|
showView("receive");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -78,6 +78,7 @@ function timeAgo(timestamp) {
|
|||||||
|
|
||||||
let loadedTxs = [];
|
let loadedTxs = [];
|
||||||
let ensNameMap = new Map();
|
let ensNameMap = new Map();
|
||||||
|
let currentSymbol = null;
|
||||||
|
|
||||||
function show() {
|
function show() {
|
||||||
const wallet = state.wallets[state.selectedWallet];
|
const wallet = state.wallets[state.selectedWallet];
|
||||||
@@ -100,6 +101,8 @@ function show() {
|
|||||||
price = getPrice(symbol);
|
price = getPrice(symbol);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
currentSymbol = symbol;
|
||||||
|
|
||||||
$("address-token-title").textContent =
|
$("address-token-title").textContent =
|
||||||
wallet.name + " \u2014 Address " + (ai + 1) + " \u2014 " + symbol;
|
wallet.name + " \u2014 Address " + (ai + 1) + " \u2014 " + symbol;
|
||||||
|
|
||||||
@@ -129,18 +132,6 @@ function show() {
|
|||||||
// Single token balance line (no tokenId — not clickable here)
|
// Single token balance line (no tokenId — not clickable here)
|
||||||
$("address-token-balance").innerHTML = balanceLine(symbol, amount, price);
|
$("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
|
// Transactions
|
||||||
$("address-token-tx-list").innerHTML =
|
$("address-token-tx-list").innerHTML =
|
||||||
'<div class="text-muted text-xs py-1">Loading...</div>';
|
'<div class="text-muted text-xs py-1">Loading...</div>';
|
||||||
@@ -363,6 +354,16 @@ function init(ctx) {
|
|||||||
color: { dark: "#000000", light: "#ffffff" },
|
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");
|
showView("receive");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -424,6 +424,7 @@ function init(ctx) {
|
|||||||
color: { dark: "#000000", light: "#ffffff" },
|
color: { dark: "#000000", light: "#ffffff" },
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
$("receive-erc20-warning").classList.add("hidden");
|
||||||
showView("receive");
|
showView("receive");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user