From 8396f7a51eaebf0a9200b8ee090409e0a2fa819b Mon Sep 17 00:00:00 2001 From: chyoo Date: Thu, 2 Jul 2026 09:22:11 +0900 Subject: [PATCH] =?UTF-8?q?=EB=A1=9C=EA=B7=B8=EB=AA=A8=EB=8B=AC=20?= =?UTF-8?q?=EC=98=A4=EB=A5=98=20=EC=88=98=EC=A0=95..?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/launcher/LauncherBuildPage.tsx | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/pages/launcher/LauncherBuildPage.tsx b/src/pages/launcher/LauncherBuildPage.tsx index 72abfb8..38e4b6d 100644 --- a/src/pages/launcher/LauncherBuildPage.tsx +++ b/src/pages/launcher/LauncherBuildPage.tsx @@ -89,6 +89,7 @@ export function LauncherBuildPage() { const currentPage = Math.min(page, totalPages); const pageStart = (currentPage - 1) * launcherBuildJobPageSize; const pagedJobs = sortedJobs.slice(pageStart, pageStart + launcherBuildJobPageSize); + const hasActiveJob = jobs.some((job) => job.status === 'PENDING' || job.status === 'RUNNING'); const refresh = () => { setLoading(true); @@ -111,6 +112,26 @@ export function LauncherBuildPage() { refresh(); }, []); + useEffect(() => { + if (!hasActiveJob) return; + const timer = window.setInterval(() => { + listLauncherBuildJobs() + .then((nextJobs) => setJobs(nextJobs)) + .catch((error: Error) => { + toast({ type: 'error', title: '빌드 작업 갱신 실패', message: error.message }); + }); + }, 2000); + return () => window.clearInterval(timer); + }, [hasActiveJob, toast]); + + useEffect(() => { + if (!selectedJob) return; + const nextSelectedJob = jobs.find((job) => job.id === selectedJob.id); + if (nextSelectedJob && nextSelectedJob !== selectedJob) { + setSelectedJob(nextSelectedJob); + } + }, [jobs, selectedJob]); + const createJob = () => { setLoading(true); createLauncherBuildJob({