실시간 차트 갱신시 화면떨림 문제 해결
This commit is contained in:
@@ -9,6 +9,8 @@ interface IndicatorModalProps {
|
||||
activeIndicators: IndicatorConfig[];
|
||||
onAdd: (def: IndicatorDef, params: Record<string, number | string | boolean>) => void;
|
||||
onRemove: (id: string) => void;
|
||||
/** type 단위 일괄 제거 (여러 인스턴스를 한 번에 제거) */
|
||||
onRemoveByType?: (type: string) => void;
|
||||
onClose: () => void;
|
||||
}
|
||||
|
||||
@@ -17,7 +19,9 @@ const CATEGORIES: IndicatorCategory[] = [
|
||||
'Trend', 'Volatility', 'Volume', 'Candlestick Patterns',
|
||||
];
|
||||
|
||||
const IndicatorModal: React.FC<IndicatorModalProps> = ({ activeIndicators, onAdd, onRemove, onClose }) => {
|
||||
const IndicatorModal: React.FC<IndicatorModalProps> = ({
|
||||
activeIndicators, onAdd, onRemove, onRemoveByType, onClose,
|
||||
}) => {
|
||||
const [search, setSearch] = useState('');
|
||||
const [category, setCategory] = useState<IndicatorCategory | 'All'>('All');
|
||||
const [selected, setSelected] = useState<IndicatorDef | null>(null);
|
||||
@@ -45,6 +49,10 @@ const IndicatorModal: React.FC<IndicatorModalProps> = ({ activeIndicators, onAdd
|
||||
};
|
||||
|
||||
const handleRemoveAll = (type: string) => {
|
||||
if (onRemoveByType) {
|
||||
onRemoveByType(type);
|
||||
return;
|
||||
}
|
||||
activeIndicators.filter(a => a.type === type).forEach(a => onRemove(a.id));
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user