Fix sync toggle issue

The sync toggle was not working as expected. This commit fixes the issue.
This commit is contained in:
gpt-engineer-app[bot]
2025-03-18 01:42:00 +00:00
parent 3ee2bc3df4
commit dfb9d8ca69
2 changed files with 11 additions and 3 deletions

View File

@@ -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;

View File

@@ -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;