가상매매 목록 실시간 연결안됨 문제수정
This commit is contained in:
@@ -219,16 +219,16 @@ export function useVirtualTradingCore(options: UseVirtualTradingCoreOptions = {}
|
||||
);
|
||||
|
||||
const mergedLiveStatus = useMemo(() => {
|
||||
if (!session.running) return liveStatusByMarket;
|
||||
const merged = { ...liveStatusByMarket };
|
||||
const now = Date.now();
|
||||
const SNAP_LIVE_MS = 12_000;
|
||||
for (const [market, snap] of Object.entries(snapshots)) {
|
||||
if (snap?.updatedAt && now - snap.updatedAt < 8000) {
|
||||
if (snap?.updatedAt && now - snap.updatedAt < SNAP_LIVE_MS) {
|
||||
merged[market] = 'live';
|
||||
}
|
||||
}
|
||||
return merged;
|
||||
}, [liveStatusByMarket, snapshots, session.running]);
|
||||
}, [liveStatusByMarket, snapshots]);
|
||||
|
||||
const handleTargetsChange = useCallback((items: VirtualTargetItem[]) => {
|
||||
if (items.length > virtualTargetMaxCount) {
|
||||
|
||||
Reference in New Issue
Block a user