Fix sync toggle issue
The sync toggle was not working as expected. This commit fixes the issue.
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
|
||||
import React from 'react';
|
||||
import { CloudOff, Loader2 } from 'lucide-react';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogClose } from '@/components/ui/dialog';
|
||||
|
||||
interface DataResetDialogProps {
|
||||
isOpen: boolean;
|
||||
onOpenChange: (open: boolean) => void;
|
||||
@@ -10,6 +12,7 @@ interface DataResetDialogProps {
|
||||
isLoggedIn: boolean;
|
||||
syncEnabled: boolean;
|
||||
}
|
||||
|
||||
const DataResetDialog: React.FC<DataResetDialogProps> = ({
|
||||
isOpen,
|
||||
onOpenChange,
|
||||
@@ -29,7 +32,11 @@ const DataResetDialog: React.FC<DataResetDialogProps> = ({
|
||||
<CloudOff size={16} className="mr-2" />
|
||||
클라우드 데이터도 함께 삭제됩니다.
|
||||
</div>
|
||||
{syncEnabled}
|
||||
{syncEnabled && (
|
||||
<div className="mt-2 text-amber-600">
|
||||
동기화 설정이 비활성화됩니다.
|
||||
</div>
|
||||
)}
|
||||
</> : "이 작업은 되돌릴 수 없으며, 모든 예산, 지출 내역, 설정이 영구적으로 삭제됩니다."}
|
||||
<div className="mt-2">
|
||||
단, '환영합니다' 화면 표시 설정과 로그인 상태는 유지됩니다.
|
||||
@@ -50,4 +57,5 @@ const DataResetDialog: React.FC<DataResetDialogProps> = ({
|
||||
</DialogContent>
|
||||
</Dialog>;
|
||||
};
|
||||
export default DataResetDialog;
|
||||
|
||||
export default DataResetDialog;
|
||||
|
||||
@@ -55,7 +55,7 @@ export const clearCloudData = async (userId: string): Promise<boolean> => {
|
||||
|
||||
// 동기화 설정 초기화 및 마지막 동기화 시간 초기화
|
||||
localStorage.removeItem('lastSync');
|
||||
localStorage.setItem('syncEnabled', 'false'); // 동기화 설정을 OFF로 변경 (수정된 부분)
|
||||
localStorage.setItem('syncEnabled', 'false'); // 동기화 설정을 OFF로 변경
|
||||
|
||||
console.log('클라우드 데이터 초기화 완료 및 동기화 설정 OFF');
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user