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 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;
|
||||||
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user