This commit is contained in:
2025-12-18 11:19:01 -05:00
parent 3e3d9ed89b
commit 2327e330de
11 changed files with 93 additions and 65 deletions

View File

@@ -68,7 +68,8 @@ export default function RequestManagement() {
}
};
useEffect(() => { fetchJobs(); }, []);
// Initial load shows the skeleton; subsequent polling should not
useEffect(() => { fetchJobs(true); }, []);
useEffect(() => {
if (isDialogVisible && selectedRequest) {
// Start polling
@@ -89,7 +90,7 @@ export default function RequestManagement() {
}, [isDialogVisible, selectedRequest?.id]);
useEffect(() => {
const hasActive = requests.some((j) => ["Queued", "Started", "Compressing"].includes(j.status));
if (hasActive && !pollingRef.current) pollingRef.current = setInterval(fetchJobs, 1500);
if (hasActive && !pollingRef.current) pollingRef.current = setInterval(() => fetchJobs(false), 1500);
else if (!hasActive && pollingRef.current) {
clearInterval(pollingRef.current);
pollingRef.current = null;