Fix TypeScript and Sync Errors
- Resolves TypeScript errors related to missing exports and incorrect argument counts. - Corrects re-exporting of types to comply with `isolatedModules` setting. - Addresses issues in sync-related files to ensure proper functionality.
This commit is contained in:
@@ -1,15 +1,14 @@
|
||||
|
||||
import { useState, useEffect } from 'react';
|
||||
import { useAuth } from '@/contexts/auth';
|
||||
import { toast } from '@/hooks/useToast.wrapper';
|
||||
import {
|
||||
isSyncEnabled,
|
||||
setSyncEnabled
|
||||
setSyncEnabled,
|
||||
trySyncAllData
|
||||
} from '@/utils/syncUtils';
|
||||
import { trySyncAllData } from '@/utils/syncUtils';
|
||||
|
||||
/**
|
||||
* 동기화 토글 기능을 위한 커스텀 훅
|
||||
* 동기화 토글 기능을 위한 커스텀 훅
|
||||
*/
|
||||
export const useSyncToggle = () => {
|
||||
const [enabled, setEnabled] = useState(isSyncEnabled());
|
||||
@@ -82,7 +81,7 @@ export const useSyncToggle = () => {
|
||||
|
||||
if (checked && user) {
|
||||
try {
|
||||
// 동기화 활성화 시 즉시 동기화 실행
|
||||
// 인자 수정: 콜백 함수 제거
|
||||
await performSync(user.id);
|
||||
} catch (error) {
|
||||
console.error('동기화 중 오류, 로컬 데이터 복원 시도:', error);
|
||||
@@ -120,11 +119,8 @@ const performSync = async (userId: string) => {
|
||||
if (!userId) return;
|
||||
|
||||
try {
|
||||
// 안전한 동기화 함수 사용 (setSyncState를 더미 함수로 제공)
|
||||
const result = await trySyncAllData(userId, (state) => {
|
||||
// 상태 업데이트 콜백 (필요에 따라 처리)
|
||||
console.log('동기화 상태 업데이트:', state);
|
||||
});
|
||||
// 인자 수정: 콜백 함수 제거
|
||||
const result = await trySyncAllData(userId);
|
||||
return result;
|
||||
} catch (error) {
|
||||
console.error('동기화 오류:', error);
|
||||
|
||||
Reference in New Issue
Block a user