서버 차트로딩중 오류 수정
This commit is contained in:
@@ -1959,10 +1959,9 @@ export function useChartWorkspace({
|
|||||||
const chartDataFetched = !useUpbit || (!isLoading && bars.length >= 2 && barsMarket === symbol);
|
const chartDataFetched = !useUpbit || (!isLoading && bars.length >= 2 && barsMarket === symbol);
|
||||||
const chartPaintComplete = layoutDef.count > 1 ? allSlotsPaintReady : singleChartPaintReady;
|
const chartPaintComplete = layoutDef.count > 1 ? allSlotsPaintReady : singleChartPaintReady;
|
||||||
const chartDataLoading = useUpbit && chartVisible && (!chartConfigReady || !chartDataFetched);
|
const chartDataLoading = useUpbit && chartVisible && (!chartConfigReady || !chartDataFetched);
|
||||||
|
/** paint 완료 = reloadAll setData까지 끝남 — chartDataFetched 와 이중 게이트 시 영구 로딩 가능 */
|
||||||
const chartAreaLoading = useUpbit && chartVisible && (
|
const chartAreaLoading = useUpbit && chartVisible && (
|
||||||
!chartConfigReady
|
!chartConfigReady || !chartPaintComplete
|
||||||
|| !chartPaintComplete
|
|
||||||
|| (layoutDef.count === 1 && !chartDataFetched)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
const viewProps: ChartWorkspaceViewProps = {
|
const viewProps: ChartWorkspaceViewProps = {
|
||||||
|
|||||||
@@ -994,13 +994,9 @@ const TradingChart: React.FC<TradingChartProps> = ({
|
|||||||
}
|
}
|
||||||
const m = managerRef.current;
|
const m = managerRef.current;
|
||||||
if (m?.hasMainSeries()) {
|
if (m?.hasMainSeries()) {
|
||||||
// 지표 일부만 로드된 경우에도 메인 캔들은 준비됨 — 실시간 틱 허용
|
// 메인 캔들만 준비되어도 paint·실시간 틱 허용 (지표는 백그라운드 복구)
|
||||||
|
setChartPaintReady(true);
|
||||||
onCandlesReady?.();
|
onCandlesReady?.();
|
||||||
const expected = countExpectedVisibleIndicators(indicatorsRef.current);
|
|
||||||
const loaded = m.getLoadedIndicatorCount();
|
|
||||||
if (expected === 0 || loaded >= expected) {
|
|
||||||
setChartPaintReady(true);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, [normalizeChartViewport, onCandlesReady, onDataLoaded, displayTimezone, timeframe, market, queueFullReload, queueIndicatorRecovery]);
|
}, [normalizeChartViewport, onCandlesReady, onDataLoaded, displayTimezone, timeframe, market, queueFullReload, queueIndicatorRecovery]);
|
||||||
|
|||||||
@@ -145,7 +145,10 @@ export function useStompChartData(
|
|||||||
/** 백엔드 history 비어 있을 때 STOMP 누적 → React bars 동기화 */
|
/** 백엔드 history 비어 있을 때 STOMP 누적 → React bars 동기화 */
|
||||||
const bootstrapFromStompRef = useRef(false);
|
const bootstrapFromStompRef = useRef(false);
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (opts.enabled === false) return;
|
if (opts.enabled === false) {
|
||||||
|
setIsLoading(false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
let cancelled = false;
|
let cancelled = false;
|
||||||
historyReadyRef.current = false;
|
historyReadyRef.current = false;
|
||||||
bootstrapFromStompRef.current = false;
|
bootstrapFromStompRef.current = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user