날짜포멧 수정
This commit is contained in:
@@ -41,6 +41,10 @@ import {
|
||||
normalizeChartTimeFormat,
|
||||
setChartTimeFormat,
|
||||
} from '../utils/chartTimeFormat';
|
||||
import {
|
||||
DEFAULT_TRADE_ALERT_TIME_FORMAT,
|
||||
setTradeAlertTimeFormat,
|
||||
} from '../utils/tradeAlertTimeFormat';
|
||||
import { DEFAULT_DISPLAY_TIMEZONE, normalizeTimezone, setDisplayTimezone } from '../utils/timezone';
|
||||
import {
|
||||
clampVirtualTargetMax,
|
||||
@@ -176,6 +180,7 @@ export function resolveAppDefaults(s: AppSettingsDto) {
|
||||
fcmPushEnabled: s.fcmPushEnabled ?? false,
|
||||
displayTimezone: normalizeTimezone(s.displayTimezone ?? DEFAULT_DISPLAY_TIMEZONE),
|
||||
chartTimeFormat: normalizeChartTimeFormat(s.chartTimeFormat ?? DEFAULT_CHART_TIME_FORMAT),
|
||||
tradeAlertTimeFormat: normalizeChartTimeFormat(s.tradeAlertTimeFormat ?? DEFAULT_TRADE_ALERT_TIME_FORMAT),
|
||||
trendSearchSettings: resolveTrendSearchAppSettings(
|
||||
s.trendSearchSettings as Partial<TrendSearchAppSettings> | null | undefined,
|
||||
),
|
||||
@@ -201,6 +206,7 @@ export function useAppSettings(sessionKey = 0) {
|
||||
setSettings(_cache);
|
||||
setDisplayTimezone(normalizeTimezone(_cache.displayTimezone ?? DEFAULT_DISPLAY_TIMEZONE));
|
||||
setChartTimeFormat(normalizeChartTimeFormat(_cache.chartTimeFormat ?? DEFAULT_CHART_TIME_FORMAT));
|
||||
setTradeAlertTimeFormat(normalizeChartTimeFormat(_cache.tradeAlertTimeFormat ?? DEFAULT_TRADE_ALERT_TIME_FORMAT));
|
||||
setIsLoaded(true);
|
||||
} else {
|
||||
setIsLoaded(false);
|
||||
@@ -210,6 +216,7 @@ export function useAppSettings(sessionKey = 0) {
|
||||
setSettings(_cache);
|
||||
setDisplayTimezone(normalizeTimezone(_cache.displayTimezone ?? DEFAULT_DISPLAY_TIMEZONE));
|
||||
setChartTimeFormat(normalizeChartTimeFormat(_cache.chartTimeFormat ?? DEFAULT_CHART_TIME_FORMAT));
|
||||
setTradeAlertTimeFormat(normalizeChartTimeFormat(_cache.tradeAlertTimeFormat ?? DEFAULT_TRADE_ALERT_TIME_FORMAT));
|
||||
setIsLoaded(true);
|
||||
} else {
|
||||
setIsLoaded(false);
|
||||
@@ -220,6 +227,7 @@ export function useAppSettings(sessionKey = 0) {
|
||||
setSettings(data);
|
||||
setDisplayTimezone(normalizeTimezone(data.displayTimezone ?? DEFAULT_DISPLAY_TIMEZONE));
|
||||
setChartTimeFormat(normalizeChartTimeFormat(data.chartTimeFormat ?? DEFAULT_CHART_TIME_FORMAT));
|
||||
setTradeAlertTimeFormat(normalizeChartTimeFormat(data.tradeAlertTimeFormat ?? DEFAULT_TRADE_ALERT_TIME_FORMAT));
|
||||
setIsLoaded(true);
|
||||
}
|
||||
}).catch(err => {
|
||||
@@ -250,6 +258,9 @@ export function useAppSettings(sessionKey = 0) {
|
||||
if (patch.chartTimeFormat != null) {
|
||||
setChartTimeFormat(normalizeChartTimeFormat(patch.chartTimeFormat));
|
||||
}
|
||||
if (patch.tradeAlertTimeFormat != null) {
|
||||
setTradeAlertTimeFormat(normalizeChartTimeFormat(patch.tradeAlertTimeFormat));
|
||||
}
|
||||
saveAppSettings(patch).then(updated => {
|
||||
if (updated) {
|
||||
_cache = { ...(_cache ?? {}), ...updated };
|
||||
|
||||
Reference in New Issue
Block a user