날짜포멧 수정
This commit is contained in:
+24
-5
@@ -21,6 +21,10 @@ import {
|
||||
setChartTimeFormat,
|
||||
useChartTimeFormat,
|
||||
} from './utils/chartTimeFormat';
|
||||
import {
|
||||
setTradeAlertTimeFormat,
|
||||
useTradeAlertTimeFormat,
|
||||
} from './utils/tradeAlertTimeFormat';
|
||||
import { normalizeTimezone, setDisplayTimezone, useDisplayTimezone } from './utils/timezone';
|
||||
import { calcStats, type PriceStats } from './utils/calculations';
|
||||
import { getKoreanName } from './utils/marketNameCache';
|
||||
@@ -192,6 +196,7 @@ function App() {
|
||||
const { permissions: menuPermissions, isLoaded: menuPermsLoaded, can: canMenu } = useMenuPermissions(sessionKey);
|
||||
const displayTimezone = useDisplayTimezone();
|
||||
const chartTimeFormat = useChartTimeFormat();
|
||||
const tradeAlertTimeFormat = useTradeAlertTimeFormat();
|
||||
|
||||
// DB 로드 전에는 localStorage 기본값, 로드 후 DB 값으로 오버라이드됨
|
||||
const [symbol, setSymbol] = useState(initial.symbol);
|
||||
@@ -266,13 +271,24 @@ function App() {
|
||||
managerRef.current?.setDisplayTimezone(next, tf, chartTimeFormat);
|
||||
}, [saveAppDef, layoutDef.count, activeSlotTf, timeframe, chartTimeFormat]);
|
||||
|
||||
const applyChartTimeFormatToManagers = useCallback((next: string) => {
|
||||
const tf = layoutDef.count > 1 ? activeSlotTf : timeframe;
|
||||
managerRef.current?.setChartTimeFormat(next);
|
||||
slotRefs.current.forEach(slot => slot?.setChartTimeFormat?.(next, tf));
|
||||
}, [layoutDef.count, activeSlotTf, timeframe]);
|
||||
|
||||
const handleChartTimeFormatChange = useCallback((format: string) => {
|
||||
const next = normalizeChartTimeFormat(format);
|
||||
setChartTimeFormat(next);
|
||||
saveAppDef({ chartTimeFormat: next });
|
||||
const tf = layoutDef.count > 1 ? activeSlotTf : timeframe;
|
||||
managerRef.current?.setDisplayTimezone(displayTimezone, tf, next);
|
||||
}, [saveAppDef, layoutDef.count, activeSlotTf, timeframe, displayTimezone]);
|
||||
applyChartTimeFormatToManagers(next);
|
||||
}, [saveAppDef, applyChartTimeFormatToManagers]);
|
||||
|
||||
const handleTradeAlertTimeFormatChange = useCallback((format: string) => {
|
||||
const next = normalizeChartTimeFormat(format);
|
||||
setTradeAlertTimeFormat(next);
|
||||
saveAppDef({ tradeAlertTimeFormat: next });
|
||||
}, [saveAppDef]);
|
||||
|
||||
const chartSymbol = layoutDef.count > 1 ? activeSlotSymbol : symbol;
|
||||
const { orderbook, wsStatus: obWsStatus, spread } = useUpbitOrderbook(chartSymbol);
|
||||
@@ -975,8 +991,9 @@ function App() {
|
||||
useEffect(() => {
|
||||
if (!appSettingsLoaded) return;
|
||||
const tf = layoutDef.count > 1 ? activeSlotTf : timeframe;
|
||||
managerRef.current?.setDisplayTimezone(displayTimezone, tf, chartTimeFormat);
|
||||
}, [appSettingsLoaded, displayTimezone, chartTimeFormat, timeframe, activeSlotTf, layoutDef.count]);
|
||||
managerRef.current?.setChartTimeFormat(chartTimeFormat);
|
||||
slotRefs.current.forEach(slot => slot?.setChartTimeFormat?.(chartTimeFormat, tf));
|
||||
}, [appSettingsLoaded, chartTimeFormat, timeframe, activeSlotTf, layoutDef.count]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!appSettingsLoaded) return;
|
||||
@@ -1910,6 +1927,8 @@ function App() {
|
||||
onDisplayTimezoneChange={handleTimezoneChange}
|
||||
chartTimeFormat={chartTimeFormat}
|
||||
onChartTimeFormatChange={handleChartTimeFormatChange}
|
||||
tradeAlertTimeFormat={tradeAlertTimeFormat}
|
||||
onTradeAlertTimeFormatChange={handleTradeAlertTimeFormatChange}
|
||||
verificationIssueNotify={appDefaults.verificationIssueNotify}
|
||||
onVerificationIssueNotify={v => saveAppDef({ verificationIssueNotify: v })}
|
||||
onFcmTest={async () => {
|
||||
|
||||
Reference in New Issue
Block a user