in-article image progress bar

This commit is contained in:
Desktop
2025-11-12 13:55:09 +05:00
parent e2026629e2
commit fe57c2d321
2 changed files with 9 additions and 4 deletions

View File

@@ -418,14 +418,19 @@ export default function ImageQueueModal({
delete progressIntervalsRef.current[item.index];
}
return { ...item, status: 'completed', progress: 100 };
} else if (index + 1 === current_image || current_image_id === item.imageId) {
// Currently processing - use backend progress if available (works for featured and in-article)
const backendProgress = (current_image_progress !== undefined && current_image_id === item.imageId)
}
// SAFE: Only change to 'processing' when backend confirms with actual image ID
// This ensures progress bar only moves when actual processing starts
// Works consistently for both featured and in-article images
else if (current_image_id === item.imageId) {
// Currently processing - use backend progress if available
const backendProgress = (current_image_progress !== undefined)
? current_image_progress
: (smoothProgress[item.index] ?? 0);
return { ...item, status: 'processing', progress: backendProgress };
}
// Keep as 'pending' until backend confirms processing with image ID
return item;
});
});