알림목록 시간봉 필터 추가

This commit is contained in:
Macbook
2026-05-30 16:37:18 +09:00
parent 42a9b6a1fb
commit d5699a827e
6 changed files with 110 additions and 21 deletions
@@ -1,4 +1,8 @@
import { getUiPreferences, patchUiPreferences } from './uiPreferencesDb';
import {
normalizeStartCandleType,
STRATEGY_CANDLE_TYPE_OPTIONS,
} from './strategyStartNodes';
import {
DEFAULT_TRADE_NOTIFICATION_GRID_PRESET,
normalizeTradeNotificationGridPreset,
@@ -38,3 +42,21 @@ export function loadTradeNotificationListSort(): TradeNotificationListSort {
export function saveTradeNotificationListSort(sort: TradeNotificationListSort): void {
patchUiPreferences({ tradeNotifications: { listSort: sort } });
}
/** 알림 목록 시간봉 필터 — '' = 전체 */
export type TradeNotificationCandleFilter = '' | (typeof STRATEGY_CANDLE_TYPE_OPTIONS)[number]['value'];
export function loadTradeNotificationCandleFilter(): TradeNotificationCandleFilter {
const raw = getUiPreferences().tradeNotifications?.candleFilter;
if (raw == null || raw === '') return '';
const n = normalizeStartCandleType(raw);
return STRATEGY_CANDLE_TYPE_OPTIONS.some(o => o.value === n)
? (n as TradeNotificationCandleFilter)
: '';
}
export function saveTradeNotificationCandleFilter(filter: TradeNotificationCandleFilter): void {
patchUiPreferences({ tradeNotifications: { candleFilter: filter || '' } });
}
export { STRATEGY_CANDLE_TYPE_OPTIONS as TRADE_NOTIFICATION_CANDLE_FILTER_OPTIONS };