탭 지표 자동추가

This commit is contained in:
Macbook
2026-05-27 13:24:05 +09:00
parent f22abbdc19
commit f7aac535d8
7 changed files with 182 additions and 11 deletions
+7 -11
View File
@@ -10,6 +10,9 @@ import {
parseCustomTabKey,
type IndicatorTabKey,
} from '../utils/indicatorMainTab';
import {
confirmAndApplyIndicatorTab,
} from '../utils/indicatorTabApply';
import {
loadCustomTabs,
createCustomTab,
@@ -379,19 +382,12 @@ const IndDropdown: React.FC<IndDropdownProps> = ({
const handleAddAllInTab = () => {
if (!addAllContext || addAllContext.types.length === 0) return;
const validTypes = addAllContext.types.filter(
type => INDICATOR_REGISTRY.some(d => d.type === type),
);
if (validTypes.length === 0) {
window.alert('추가할 지표가 없습니다.');
if (category === 'Main') {
confirmAndApplyIndicatorTab({ kind: 'main' }, onAddMany, onAdd);
return;
}
const msg = `기존 보조지표를 모두 제거하고 ${addAllContext.label} 탭의 지표 ${validTypes.length}개로 교체하시겠습니까?`;
if (!window.confirm(msg)) return;
if (onAddMany) {
onAddMany(validTypes);
} else {
validTypes.forEach(type => onAdd(type));
if (isCustomTabKey(category) && selectedCustomTab) {
confirmAndApplyIndicatorTab({ kind: 'custom', tab: selectedCustomTab }, onAddMany, onAdd);
}
};