Fix OKX header trade stats stuck at zero after settings shell load.
Always SSR records summary on embed shell (including settings/risk/env), and refresh total/win-rate/PL ratio via account_snapshot so soft-nav cannot leave the strip blank. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1178,6 +1178,20 @@ function applyAccountSnapshot(data){
|
||||
if(typeof data.unrealized_pnl !== "undefined"){
|
||||
updateRealtimePnl(data.unrealized_pnl);
|
||||
}
|
||||
if(typeof data.total !== "undefined" && data.total !== null){
|
||||
setFundsFieldText("stat-total", String(data.total));
|
||||
}
|
||||
if(typeof data.rate !== "undefined" && data.rate !== null){
|
||||
setFundsFieldText("stat-rate", `${Number(data.rate)}%`);
|
||||
}
|
||||
if(typeof data.profit_loss_ratio !== "undefined"){
|
||||
setFundsFieldText(
|
||||
"stat-pl-ratio",
|
||||
data.profit_loss_ratio != null && data.profit_loss_ratio !== ""
|
||||
? String(data.profit_loss_ratio)
|
||||
: "—"
|
||||
);
|
||||
}
|
||||
if(typeof data.available_trading_usdt !== "undefined" && data.available_trading_usdt !== null){
|
||||
latestAvailableUsdt = Number(data.available_trading_usdt);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user