로그모달 오류 수정..

This commit is contained in:
2026-07-02 09:22:11 +09:00
parent f1c2471c6c
commit 8396f7a51e
+21
View File
@@ -89,6 +89,7 @@ export function LauncherBuildPage() {
const currentPage = Math.min(page, totalPages); const currentPage = Math.min(page, totalPages);
const pageStart = (currentPage - 1) * launcherBuildJobPageSize; const pageStart = (currentPage - 1) * launcherBuildJobPageSize;
const pagedJobs = sortedJobs.slice(pageStart, pageStart + launcherBuildJobPageSize); const pagedJobs = sortedJobs.slice(pageStart, pageStart + launcherBuildJobPageSize);
const hasActiveJob = jobs.some((job) => job.status === 'PENDING' || job.status === 'RUNNING');
const refresh = () => { const refresh = () => {
setLoading(true); setLoading(true);
@@ -111,6 +112,26 @@ export function LauncherBuildPage() {
refresh(); 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 = () => { const createJob = () => {
setLoading(true); setLoading(true);
createLauncherBuildJob({ createLauncherBuildJob({