Address accessibility issue

The screen was not visible. This commit addresses an accessibility issue.
This commit is contained in:
gpt-engineer-app[bot]
2025-03-15 05:18:48 +00:00
parent 1676fb1649
commit 3bb4781ff0
3 changed files with 96 additions and 7 deletions

View File

@@ -1,5 +1,5 @@
import { isSyncEnabled, setSyncEnabled, getLastSyncTime, setLastSyncTime } from './sync/syncSettings';
import { isSyncEnabled, setSyncEnabled, getLastSyncTime, setLastSyncTime, initSyncSettings } from './sync/syncSettings';
import { uploadTransactions, downloadTransactions } from './sync/transactionSync';
import { uploadBudgets, downloadBudgets } from './sync/budgetSync';
@@ -12,7 +12,8 @@ export {
uploadBudgets,
downloadBudgets,
getLastSyncTime,
setLastSyncTime
setLastSyncTime,
initSyncSettings
};
/**
@@ -33,5 +34,19 @@ export const syncAllData = async (userId: string): Promise<void> => {
console.log('데이터 동기화 완료!');
} catch (error) {
console.error('동기화 중 오류 발생:', error);
throw error; // 오류를 상위 호출자에게 전달하여 적절히 처리하도록 함
}
};
// 안전하게 동기화 시도하는 함수 추가
export const trySyncAllData = async (userId: string): Promise<{ success: boolean, error?: any }> => {
if (!userId || !isSyncEnabled()) return { success: true };
try {
await syncAllData(userId);
return { success: true };
} catch (error) {
console.error('동기화 시도 중 오류:', error);
return { success: false, error };
}
};