mobile download
This commit is contained in:
@@ -1,29 +1,18 @@
|
||||
/**
|
||||
* 지표 추가 팝업 — Main(주요지표) 탭 표시·적용 순서
|
||||
* 지표 추가 팝업 — Main(주요지표) 탭 표시·적용 순서 (DB)
|
||||
*/
|
||||
import { MAIN_INDICATOR_TYPES } from './indicatorMainTab';
|
||||
import { mergeIndicatorListOrder } from './indicatorListOrder';
|
||||
|
||||
const STORAGE_KEY = 'gc_indicator_main_tab_order';
|
||||
import { getUiPreferences, patchUiPreferences } from './uiPreferencesDb';
|
||||
|
||||
export function loadMainTabOrder(): string[] | null {
|
||||
try {
|
||||
const raw = localStorage.getItem(STORAGE_KEY);
|
||||
if (!raw) return null;
|
||||
const parsed = JSON.parse(raw) as unknown;
|
||||
if (!Array.isArray(parsed)) return null;
|
||||
return parsed.filter((t): t is string => typeof t === 'string' && t.length > 0);
|
||||
} catch {
|
||||
return 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 {
|
||||
try {
|
||||
localStorage.setItem(STORAGE_KEY, JSON.stringify(types));
|
||||
} catch {
|
||||
/* quota */
|
||||
}
|
||||
patchUiPreferences({ indicator: { mainTabOrder: types } });
|
||||
}
|
||||
|
||||
export function getOrderedMainIndicatorTypes(): string[] {
|
||||
|
||||
Reference in New Issue
Block a user