in-article image progress bar
This commit is contained in:
@@ -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;
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user