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 React from 'react';
import { CloudOff, Loader2 } from 'lucide-react'; import { CloudOff, Loader2 } from 'lucide-react';
import { Button } from '@/components/ui/button'; import { Button } from '@/components/ui/button';
import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogClose } from '@/components/ui/dialog'; import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogClose } from '@/components/ui/dialog';
interface DataResetDialogProps { interface DataResetDialogProps {
isOpen: boolean; isOpen: boolean;
onOpenChange: (open: boolean) => void; onOpenChange: (open: boolean) => void;
@@ -10,6 +12,7 @@ interface DataResetDialogProps {
isLoggedIn: boolean; isLoggedIn: boolean;
syncEnabled: boolean; syncEnabled: boolean;
} }
const DataResetDialog: React.FC<DataResetDialogProps> = ({ const DataResetDialog: React.FC<DataResetDialogProps> = ({
isOpen, isOpen,
onOpenChange, onOpenChange,
@@ -29,7 +32,11 @@ const DataResetDialog: React.FC<DataResetDialogProps> = ({
<CloudOff size={16} className="mr-2" /> <CloudOff size={16} className="mr-2" />
. .
</div> </div>
{syncEnabled} {syncEnabled && (
<div className="mt-2 text-amber-600">
.
</div>
)}
</> : "이 작업은 되돌릴 수 없으며, 모든 예산, 지출 내역, 설정이 영구적으로 삭제됩니다."} </> : "이 작업은 되돌릴 수 없으며, 모든 예산, 지출 내역, 설정이 영구적으로 삭제됩니다."}
<div className="mt-2"> <div className="mt-2">
, '환영합니다' . , '환영합니다' .
@@ -50,4 +57,5 @@ const DataResetDialog: React.FC<DataResetDialogProps> = ({
</DialogContent> </DialogContent>
</Dialog>; </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.removeItem('lastSync');
localStorage.setItem('syncEnabled', 'false'); // 동기화 설정을 OFF로 변경 (수정된 부분) localStorage.setItem('syncEnabled', 'false'); // 동기화 설정을 OFF로 변경
console.log('클라우드 데이터 초기화 완료 및 동기화 설정 OFF'); console.log('클라우드 데이터 초기화 완료 및 동기화 설정 OFF');
return true; return true;