알림목록 시간봉 필터 추가
This commit is contained in:
@@ -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 };
|
||||
|
||||
Reference in New Issue
Block a user