From 8db0a574abca6d78e02603ef7481f94f63e55c82 Mon Sep 17 00:00:00 2001 From: caadiq Date: Fri, 9 Jan 2026 20:31:47 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EB=B4=87=20=EA=B4=80=EB=A6=AC=20?= =?UTF-8?q?=ED=8E=98=EC=9D=B4=EC=A7=80=20=EC=95=A0=EB=8B=88=EB=A9=94?= =?UTF-8?q?=EC=9D=B4=EC=85=98=20=EC=B5=9C=EC=A0=81=ED=99=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 시작/중지 시 로컬 상태만 업데이트하여 전체 목록 새로고침 방지 - isInitialLoad 상태로 첫 로드 시에만 애니메이션 실행 - 새로고침 버튼 클릭 시에도 애니메이션 실행 --- frontend/src/pages/pc/admin/AdminScheduleBots.jsx | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/frontend/src/pages/pc/admin/AdminScheduleBots.jsx b/frontend/src/pages/pc/admin/AdminScheduleBots.jsx index 0642b80..be9b35f 100644 --- a/frontend/src/pages/pc/admin/AdminScheduleBots.jsx +++ b/frontend/src/pages/pc/admin/AdminScheduleBots.jsx @@ -14,6 +14,7 @@ function AdminScheduleBots() { const [toast, setToast] = useState(null); const [bots, setBots] = useState([]); const [loading, setLoading] = useState(true); + const [isInitialLoad, setIsInitialLoad] = useState(true); // 첫 로드 여부 (애니메이션용) const [syncing, setSyncing] = useState(null); // 동기화 중인 봇 ID const [quotaWarning, setQuotaWarning] = useState(null); // 할당량 경고 상태 @@ -110,11 +111,16 @@ function AdminScheduleBots() { }); if (response.ok) { + // 로컬 상태만 업데이트 (전체 목록 새로고침 대신) + setBots(prev => prev.map(bot => + bot.id === botId + ? { ...bot, status: action === 'start' ? 'running' : 'stopped' } + : bot + )); setToast({ type: 'success', message: action === 'start' ? `${botName} 봇이 시작되었습니다.` : `${botName} 봇이 정지되었습니다.` }); - fetchBots(); // 목록 새로고침 } else { const data = await response.json(); setToast({ type: 'error', message: data.error || '작업 실패' }); @@ -328,7 +334,7 @@ function AdminScheduleBots() {

봇 목록