Fix from address not showing when Send clicked from main view
check / check (push) Has been cancelled

Move renderSendTokenSelect to send.js so both the main view and
address detail view call it before navigating to send. Without it,
the token dropdown was stale and updateSendBalance had no context.
Цей коміт міститься в:
2026-02-26 03:49:20 +07:00
джерело 4ea5eeabda
коміт 2d328c7389
3 змінених файлів з 15 додано та 14 видалено
+1 -12
Переглянути файл
@@ -12,7 +12,7 @@ const { state, currentAddress } = require("../../shared/state");
const { formatUsd, getAddressValueUsd } = require("../../shared/prices");
const { fetchRecentTransactions } = require("../../shared/transactions");
const { resolveEnsNames } = require("../../shared/ens");
const { updateSendBalance } = require("./send");
const { updateSendBalance, renderSendTokenSelect } = require("./send");
const { log } = require("../../shared/log");
const QRCode = require("qrcode");
@@ -187,17 +187,6 @@ function showTxDetail(tx) {
showView("transaction");
}
function renderSendTokenSelect(addr) {
const sel = $("send-token");
sel.innerHTML = '<option value="ETH">ETH</option>';
for (const t of addr.tokenBalances || []) {
const opt = document.createElement("option");
opt.value = t.address;
opt.textContent = t.symbol;
sel.appendChild(opt);
}
}
function init(ctx) {
$("address-full").addEventListener("click", () => {
const addr = $("address-full").dataset.full;
+2 -1
Переглянути файл
@@ -7,7 +7,7 @@ const {
truncateMiddle,
} = require("./helpers");
const { state, saveState, currentAddress } = require("../../shared/state");
const { updateSendBalance } = require("./send");
const { updateSendBalance, renderSendTokenSelect } = require("./send");
const QRCode = require("qrcode");
const { deriveAddressFromXpub } = require("../../shared/wallet");
const {
@@ -139,6 +139,7 @@ function init(ctx) {
}
$("send-to").value = "";
$("send-amount").value = "";
renderSendTokenSelect(addr);
updateSendBalance();
showView("send");
});
+12 -1
Переглянути файл
@@ -4,6 +4,17 @@ const { $, showFlash, formatAddressHtml } = require("./helpers");
const { state, currentAddress } = require("../../shared/state");
const { getProvider } = require("../../shared/balances");
function renderSendTokenSelect(addr) {
const sel = $("send-token");
sel.innerHTML = '<option value="ETH">ETH</option>';
for (const t of addr.tokenBalances || []) {
const opt = document.createElement("option");
opt.value = t.address;
opt.textContent = t.symbol;
sel.appendChild(opt);
}
}
function updateSendBalance() {
const addr = currentAddress();
if (!addr) return;
@@ -77,4 +88,4 @@ function init(ctx) {
$("btn-send-back").addEventListener("click", ctx.showAddressDetail);
}
module.exports = { init, updateSendBalance };
module.exports = { init, updateSendBalance, renderSendTokenSelect };