Fix type errors in sync settings
This commit addresses several TypeScript errors in the sync settings component and related utility functions. It corrects type definitions for the sync result, ensures correct usage of the `setLastSyncTime` function, and fixes toast variants.
This commit is contained in:
@@ -3,7 +3,7 @@ import React, { useState, useEffect } from 'react';
|
||||
import { Switch } from "@/components/ui/switch";
|
||||
import { Label } from "@/components/ui/label";
|
||||
import { CloudUpload, RefreshCw, AlertCircle } from "lucide-react";
|
||||
import { isSyncEnabled, setSyncEnabled, syncAllData, getLastSyncTime, trySyncAllData } from "@/utils/syncUtils";
|
||||
import { isSyncEnabled, setSyncEnabled, syncAllData, getLastSyncTime, trySyncAllData, SyncResult } from "@/utils/syncUtils";
|
||||
import { toast } from "@/hooks/useToast.wrapper";
|
||||
import { useAuth } from "@/contexts/auth";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
@@ -59,7 +59,7 @@ const SyncSettings = () => {
|
||||
toast({
|
||||
title: "동기화 일부 완료",
|
||||
description: "일부 데이터만 동기화되었습니다. 다시 시도해보세요.",
|
||||
variant: "warning"
|
||||
variant: "destructive"
|
||||
});
|
||||
} else {
|
||||
toast({
|
||||
@@ -115,13 +115,13 @@ const SyncSettings = () => {
|
||||
toast({
|
||||
title: "다운로드만 성공",
|
||||
description: "서버 데이터를 가져왔지만, 업로드에 실패했습니다.",
|
||||
variant: "warning"
|
||||
variant: "destructive"
|
||||
});
|
||||
} else if (result.uploadSuccess) {
|
||||
toast({
|
||||
title: "업로드만 성공",
|
||||
description: "로컬 데이터를 업로드했지만, 다운로드에 실패했습니다.",
|
||||
variant: "warning"
|
||||
variant: "destructive"
|
||||
});
|
||||
}
|
||||
setLastSync(getLastSyncTime());
|
||||
|
||||
Reference in New Issue
Block a user