Ensure sync is disabled
The sync setting was not consistently being disabled in certain scenarios. This change ensures that the sync setting is properly disabled when expected.
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
|
||||
import { Transaction } from '@/components/TransactionCard';
|
||||
|
||||
// 트랜잭션 데이터 불러오기
|
||||
@@ -99,7 +100,7 @@ export const resetAllStorageData = (): void => {
|
||||
'budgetHistory',
|
||||
'transactionHistory',
|
||||
'lastSync',
|
||||
'syncEnabled', // 동기화 설정도 초기화 (변경된 부분)
|
||||
'syncEnabled', // 동기화 설정도 초기화
|
||||
];
|
||||
|
||||
// 키 삭제
|
||||
@@ -153,14 +154,16 @@ export const resetAllStorageData = (): void => {
|
||||
localStorage.setItem('supabase.auth.token', supabase);
|
||||
}
|
||||
|
||||
// 동기화 설정은 OFF로 설정 (변경된 부분)
|
||||
// 동기화 설정은 무조건 OFF로 설정
|
||||
localStorage.setItem('syncEnabled', 'false');
|
||||
console.log('동기화 설정이 OFF로 변경되었습니다');
|
||||
|
||||
// 이벤트 발생
|
||||
window.dispatchEvent(new Event('transactionUpdated'));
|
||||
window.dispatchEvent(new Event('budgetDataUpdated'));
|
||||
window.dispatchEvent(new Event('categoryBudgetsUpdated'));
|
||||
window.dispatchEvent(new StorageEvent('storage'));
|
||||
window.dispatchEvent(new Event('auth-state-changed')); // 동기화 상태 변경 이벤트 추가
|
||||
|
||||
console.log('모든 저장소 데이터가 완전히 초기화되었습니다. (동기화 설정이 OFF로 변경됨)');
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user