Update last sync time
Ensure the last sync time is updated after adding a budget.
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
* 데이터 동기화 메인 모듈
|
||||
*/
|
||||
import { isSyncEnabled } from './config';
|
||||
import { setLastSyncTime } from './time';
|
||||
import { setLastSyncTime } from '../syncUtils';
|
||||
import {
|
||||
BackupData,
|
||||
SyncResult,
|
||||
@@ -107,15 +107,20 @@ export const syncAllData = async (userId: string): Promise<SyncResult> => {
|
||||
// 전체 성공 여부 설정
|
||||
result.success = result.uploadSuccess || result.downloadSuccess;
|
||||
|
||||
// 동기화 시간 기록
|
||||
// 동기화 시간 기록 - 추가 디버깅 로그 및 중요 부분
|
||||
if (result.success) {
|
||||
setLastSyncTime(new Date().toISOString());
|
||||
const currentTime = new Date().toISOString();
|
||||
console.log('동기화 성공, 시간 업데이트:', currentTime);
|
||||
setLastSyncTime(currentTime);
|
||||
} else {
|
||||
console.log('동기화 실패, 시간 업데이트 안함');
|
||||
}
|
||||
|
||||
console.log('데이터 동기화 결과:', result);
|
||||
return result;
|
||||
} catch (error) {
|
||||
// 오류 발생 시 백업 데이터 복원
|
||||
console.error('동기화 중 오류 발생:', error);
|
||||
recoverFromSyncError(backup, error);
|
||||
|
||||
return result;
|
||||
|
||||
Reference in New Issue
Block a user