修复实盘顶栏误显示模拟盘会话资金:无交易所余额时显示 —,切模式清缓存。
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1212,9 +1212,13 @@ function applyAccountSnapshot(data){
|
||||
applyOptionsFundsVisibility(!coinMode);
|
||||
if(data.funding_usdt != null && data.funding_usdt !== ""){
|
||||
setFundsFieldText("total-capital", `${Number(data.funding_usdt).toFixed(2)}U`);
|
||||
} else if("funding_usdt" in data){
|
||||
setFundsFieldText("total-capital", "—");
|
||||
}
|
||||
if(data.total_funds != null && data.total_funds !== ""){
|
||||
setFundsFieldText("total-funds", `${Number(data.total_funds).toFixed(2)}U`);
|
||||
} else if("total_funds" in data){
|
||||
setFundsFieldText("total-funds", "—");
|
||||
}
|
||||
if(data.current_capital != null && data.current_capital !== "" && !Number.isNaN(Number(data.current_capital))){
|
||||
setFundsFieldText(
|
||||
@@ -1226,6 +1230,16 @@ function applyAccountSnapshot(data){
|
||||
data.options_margin_mode
|
||||
)
|
||||
);
|
||||
} else if("current_capital" in data){
|
||||
setFundsFieldText(
|
||||
"current-capital",
|
||||
formatTradingAccountLabel(
|
||||
null,
|
||||
data.options_trading_eth,
|
||||
data.options_trading_btc,
|
||||
data.options_margin_mode
|
||||
)
|
||||
);
|
||||
}
|
||||
if(!coinMode && (data.options_funding_usdc != null || data.options_funding_usdt != null || data.options_funding_eth != null)){
|
||||
const optFunding = formatOptionsFundingLabel(
|
||||
|
||||
@@ -1691,9 +1691,13 @@ function applyAccountSnapshot(data){
|
||||
applyOptionsFundsVisibility(!coinMode);
|
||||
if(data.funding_usdt != null && data.funding_usdt !== ""){
|
||||
setFundsFieldText("total-capital", `${Number(data.funding_usdt).toFixed(2)}U`);
|
||||
} else if("funding_usdt" in data){
|
||||
setFundsFieldText("total-capital", "—");
|
||||
}
|
||||
if(data.total_funds != null && data.total_funds !== ""){
|
||||
setFundsFieldText("total-funds", `${Number(data.total_funds).toFixed(2)}U`);
|
||||
} else if("total_funds" in data){
|
||||
setFundsFieldText("total-funds", "—");
|
||||
}
|
||||
if(data.current_capital != null && data.current_capital !== "" && !Number.isNaN(Number(data.current_capital))){
|
||||
setFundsFieldText(
|
||||
@@ -1705,6 +1709,16 @@ function applyAccountSnapshot(data){
|
||||
data.options_margin_mode
|
||||
)
|
||||
);
|
||||
} else if("current_capital" in data){
|
||||
setFundsFieldText(
|
||||
"current-capital",
|
||||
formatTradingAccountLabel(
|
||||
null,
|
||||
data.options_trading_eth,
|
||||
data.options_trading_btc,
|
||||
data.options_margin_mode
|
||||
)
|
||||
);
|
||||
}
|
||||
if(!coinMode && (data.options_funding_usdc != null || data.options_funding_usdt != null || data.options_funding_eth != null)){
|
||||
const optFunding = formatOptionsFundingLabel(
|
||||
|
||||
Reference in New Issue
Block a user