Fix TS errors and module issues

- Corrected module exports and imports to resolve TypeScript errors.
- Fixed property access errors in budget synchronization logic.
This commit is contained in:
gpt-engineer-app[bot]
2025-03-21 11:30:08 +00:00
parent 8e6eb9d8aa
commit 42c9bc4000
5 changed files with 119 additions and 8 deletions

View File

@@ -1,9 +1,40 @@
// 편의를 위한 인덱스 파일
// 모든 동기화 관련 함수들을 하나로 모아서 내보
export * from './sync/syncSettings';
// sync 디렉토리의 함수들 내보내기
export * from './sync/data';
export * from './sync/time';
export * from './sync/transaction';
export * from './sync/budget';
export * from './sync/clearCloudData';
// 설정 관련 함수들 내보내기 - 이름 충돌 방지를 위해 명시적으로 내보내기
export {
isSyncEnabled,
setSyncEnabled,
initSyncSettings
} from './sync/config';
// 동기화 상태 초기화 함수 추가
export const initSyncState = async (): Promise<void> => {
try {
// 동기화 설정 초기화
initSyncSettings();
console.log('동기화 설정 초기화 완료');
// 네트워크 상태 모니터링 시작
window.addEventListener('online', () => {
console.log('네트워크 연결됨');
window.dispatchEvent(new Event('networkStatusChanged'));
});
window.addEventListener('offline', () => {
console.log('네트워크 연결 끊김');
window.dispatchEvent(new Event('networkStatusChanged'));
});
console.log('네트워크 모니터링 시작됨');
} catch (error) {
console.error('동기화 상태 초기화 오류:', error);
}
};