mirror of
https://github.com/NoFxAiOS/nofx.git
synced 2026-07-11 06:46:59 +08:00
fix: show -- instead of 0 when account data fetch fails on dashboard
Replace zero-value fallback with undefined, pass accountFailed prop to distinguish load failure from initial loading skeleton.
This commit is contained in:
@@ -322,10 +322,7 @@ function App() {
|
||||
|
||||
const selectedTrader = traders?.find((t) => t.trader_id === selectedTraderId)
|
||||
|
||||
// When polling has permanently failed, provide zero-value data instead of keeping skeleton
|
||||
const effectiveAccount = (accountPollOff && !account)
|
||||
? { total_equity: 0, available_balance: 0, total_pnl: 0, total_pnl_pct: 0, position_count: 0, margin_used: 0, margin_used_pct: 0 } as AccountInfo
|
||||
: account
|
||||
const effectiveAccount = account
|
||||
const effectivePositions = (positionsPollOff && !positions) ? [] as Position[] : positions
|
||||
const effectiveDecisions = (decisionsPollOff && !decisions) ? [] as DecisionRecord[] : decisions
|
||||
|
||||
@@ -545,6 +542,7 @@ function App() {
|
||||
selectedTrader={selectedTrader}
|
||||
status={status}
|
||||
account={effectiveAccount}
|
||||
accountFailed={accountPollOff}
|
||||
positions={effectivePositions}
|
||||
decisions={effectiveDecisions}
|
||||
decisionsLimit={decisionsLimit}
|
||||
|
||||
Reference in New Issue
Block a user