diff --git a/src/web_dashboard.py b/src/web_dashboard.py index 17ae7d5..bf568c0 100644 --- a/src/web_dashboard.py +++ b/src/web_dashboard.py @@ -59,7 +59,9 @@ async def dashboard(): const r = await fetch("/api/state"); const d = await r.json(); - const usdt = (d.balance && d.balance.USDT) ? d.balance.USDT.free || 0 : 0; + const usdt_data = d.balance && d.balance.USDT ? d.balance.USDT : {free: 0}; + const usdt = parseFloat(usdt_data.free) || 0; + console.log("USDT from API:", usdt_data, "parsed:", usdt); document.getElementById("usdt").textContent = usdt.toFixed(2); document.getElementById("trades").textContent = d.trades_today || 0;