Fix welcome message and sync
- Prevent duplicate welcome messages. - Remove sync notifications. - Ensure automatic sync updates last sync time.
This commit is contained in:
@@ -60,15 +60,23 @@ export const setLastSyncTime = (timestamp: string): void => {
|
||||
// 이벤트 발생 - 커스텀 이벤트로 변경하여 디버깅 용이하게
|
||||
try {
|
||||
const event = new CustomEvent('syncTimeUpdated', {
|
||||
detail: { time: timestamp }
|
||||
detail: { time: timestamp, source: 'setLastSyncTime' }
|
||||
});
|
||||
window.dispatchEvent(event);
|
||||
console.log('syncTimeUpdated 이벤트 발생 완료');
|
||||
console.log('syncTimeUpdated 이벤트 발생 완료 (setLastSyncTime에서 호출)');
|
||||
|
||||
// 스토리지 이벤트도 함께 발생시켜 다중 환경에서도 동작하도록 함
|
||||
window.dispatchEvent(new StorageEvent('storage', {
|
||||
key: 'lastSync',
|
||||
newValue: timestamp
|
||||
}));
|
||||
} catch (error) {
|
||||
console.error('동기화 시간 이벤트 발생 오류:', error);
|
||||
}
|
||||
};
|
||||
|
||||
// syncUtils.ts에서 사용하던 함수들도 여기로 통합
|
||||
export { trySyncAllData } from './sync/data';
|
||||
// syncUtils.ts에서 사용하던 함수들
|
||||
// 수정: 하위 경로에서 가져오는 대신 직접 가져오기
|
||||
import { trySyncAllData } from './sync/data';
|
||||
export { trySyncAllData };
|
||||
export type { SyncResult } from './sync/data';
|
||||
|
||||
Reference in New Issue
Block a user