위젯 기능 추가

This commit is contained in:
Macbook
2026-06-14 01:03:51 +09:00
parent 95595f7e9e
commit 6936792ad4
57 changed files with 6728 additions and 540 deletions
+7
View File
@@ -60,6 +60,7 @@ import {
type ChartPaneSeparatorOptions,
} from '../types/chartPaneSeparator';
import { migrateLocalStorageToUiPreferences } from '../utils/uiPreferencesMigrate';
import { reconcilePendingUiPreferencesOnLoad } from '../utils/uiPreferencesDb';
import { loadLocalTheme } from '../utils/localThemeStorage';
// 전역 캐시 — 여러 컴포넌트에서 공유하여 중복 요청 방지
@@ -79,6 +80,11 @@ export function getAppSettingsCache(): AppSettingsDto {
return _cache ?? {};
}
/** DB에서 앱 설정 로드가 완료되었는지 (null 캐시 = 미로드) */
export function isAppSettingsCacheLoaded(): boolean {
return _cache !== null;
}
/** 낙관적 캐시 패치 — _cache 가 null 일 때도 다음 로드 전까지 임시 보관 */
export function patchAppSettingsCache(patch: Partial<AppSettingsDto>): void {
if (_cache !== null) {
@@ -102,6 +108,7 @@ function ensureLoaded(): Promise<AppSettingsDto> {
return _cache ?? {};
}
_cache = data ?? {};
reconcilePendingUiPreferencesOnLoad();
const migrated = migrateLocalStorageToUiPreferences(_cache);
if (migrated?.changed) {
try {