Fix welcome message and sync
- Prevent duplicate welcome messages. - Remove sync notifications. - Ensure automatic sync updates last sync time.
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
|
||||
import React from 'react';
|
||||
import React, { useEffect } from 'react';
|
||||
import { RefreshCw } from "lucide-react";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import useNotifications from '@/hooks/useNotifications';
|
||||
|
||||
interface SyncStatusProps {
|
||||
enabled: boolean;
|
||||
@@ -20,6 +21,18 @@ const SyncStatus: React.FC<SyncStatusProps> = ({
|
||||
onManualSync
|
||||
}) => {
|
||||
const navigate = useNavigate();
|
||||
const { addNotification } = useNotifications();
|
||||
|
||||
// 동기화 버튼 클릭 시 알림 추가
|
||||
const handleSyncClick = async () => {
|
||||
if (syncing) return;
|
||||
|
||||
try {
|
||||
await onManualSync();
|
||||
} catch (error) {
|
||||
console.error('수동 동기화 실패:', error);
|
||||
}
|
||||
};
|
||||
|
||||
if (!enabled) return null;
|
||||
|
||||
@@ -29,7 +42,7 @@ const SyncStatus: React.FC<SyncStatusProps> = ({
|
||||
<div className="flex justify-between items-center text-sm">
|
||||
<span className="text-muted-foreground">마지막 동기화: {lastSync}</span>
|
||||
<button
|
||||
onClick={onManualSync}
|
||||
onClick={handleSyncClick}
|
||||
disabled={syncing}
|
||||
className="neuro-button py-1 px-3 flex items-center gap-1 bg-neuro-income text-white hover:bg-neuro-income/90"
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user