diff --git a/frontend/src/components/download/DownloadCenter.tsx b/frontend/src/components/download/DownloadCenter.tsx index 2e4688b..9a7c3f8 100644 --- a/frontend/src/components/download/DownloadCenter.tsx +++ b/frontend/src/components/download/DownloadCenter.tsx @@ -241,7 +241,7 @@ export default function DownloadCenter({ onPlayMusic }: DownloadCenterProps) { } const tasks = status?.tasks || [] - const sortedTasks = [...tasks].sort((a, b) => + const sortedTasks = [...tasks].sort((a, b) => new Date(b.created_at).getTime() - new Date(a.created_at).getTime() ) @@ -290,9 +290,7 @@ export default function DownloadCenter({ onPlayMusic }: DownloadCenterProps) {
{autoJobs.map((job) => { - // Debug: log job status - console.log('Job:', job.song_name, 'Status:', job.status, 'Should show retry:', (job.status === 'failed' || job.status === 'cancelled')); - + return (
)} - + {/* Cancel button for active jobs */} {(job.status === 'pending' || job.status === 'searching' || job.status === 'downloading') && ( )} - + {/* Retry button for failed/cancelled jobs */} {(job.status === 'failed' || job.status === 'cancelled') && ( )} - + {/* Delete button - always visible */} )} - + {(task.status === 'completed' || task.status === 'failed') && (