21 lines
778 B
TypeScript
21 lines
778 B
TypeScript
/**
|
|
* 지표 추가 팝업 — Main(주요지표) 탭 표시·적용 순서 (DB)
|
|
*/
|
|
import { MAIN_INDICATOR_TYPES } from './indicatorMainTab';
|
|
import { mergeIndicatorListOrder } from './indicatorListOrder';
|
|
import { getUiPreferences, patchUiPreferences } from './uiPreferencesDb';
|
|
|
|
export function loadMainTabOrder(): string[] | null {
|
|
const order = getUiPreferences().indicator?.mainTabOrder;
|
|
if (!order?.length) return null;
|
|
return order.filter((t): t is string => typeof t === 'string' && t.length > 0);
|
|
}
|
|
|
|
export function saveMainTabOrder(types: string[]): void {
|
|
patchUiPreferences({ indicator: { mainTabOrder: types } });
|
|
}
|
|
|
|
export function getOrderedMainIndicatorTypes(): string[] {
|
|
return mergeIndicatorListOrder(loadMainTabOrder(), MAIN_INDICATOR_TYPES);
|
|
}
|