지표탭 추가
This commit is contained in:
@@ -50,6 +50,7 @@ import {
|
||||
mergeIndicators,
|
||||
reorderIndicatorGroup,
|
||||
splitIndicatorPane,
|
||||
buildIndicatorConfigsFromTypes,
|
||||
} from './utils/indicatorPaneMerge';
|
||||
import { useAppSettings } from './hooks/useAppSettings';
|
||||
import { clampVirtualTargetMax } from './utils/virtualTargetLimits';
|
||||
@@ -1365,6 +1366,22 @@ function App() {
|
||||
});
|
||||
}, [layoutDef.count, activeSlot, getParams, getVisualConfig]);
|
||||
|
||||
/** 지표 추가 팝업 — 탭 전체 추가 (한 번에 상태 반영) */
|
||||
const handleAddIndicators = useCallback((types: string[]) => {
|
||||
if (!types.length) return;
|
||||
if (layoutDef.count > 1) {
|
||||
const slotRef = slotRefs.current[activeSlot];
|
||||
if (slotRef) {
|
||||
slotRef.addIndicators(types);
|
||||
return;
|
||||
}
|
||||
}
|
||||
setIndicators(prev => {
|
||||
const added = buildIndicatorConfigsFromTypes(types, prev, getParams, getVisualConfig, newIndId);
|
||||
return added.length > 0 ? [...prev, ...added] : prev;
|
||||
});
|
||||
}, [layoutDef.count, activeSlot, getParams, getVisualConfig]);
|
||||
|
||||
/**
|
||||
* 지표 제거 (type 기준):
|
||||
* - 싱글: 메인 차트에서 제거
|
||||
@@ -1795,6 +1812,7 @@ function App() {
|
||||
onFitContent={() => managerRef.current?.fitContent()}
|
||||
onScrollToNow={() => managerRef.current?.scrollToRealTime()}
|
||||
onAddIndicator={handleAddIndicator}
|
||||
onAddIndicators={handleAddIndicators}
|
||||
onRemoveByType={handleRemoveByType}
|
||||
onOpenBulkIndicatorSettings={() => setShowBulkIndSettings(true)}
|
||||
onOpenIndicatorSettings={handleOpenIndicatorSettings}
|
||||
|
||||
Reference in New Issue
Block a user