chore(frontend): remove live song-list refresh during S3 sync per request; refresh now only on manual actions/page reload

This commit is contained in:
Geert Rademakes 2025-08-08 08:47:39 +02:00
parent 482460a8b7
commit 83b4682b0e
2 changed files with 2 additions and 16 deletions

View File

@ -128,8 +128,7 @@ const RekordboxReader: React.FC = () => {
totalDuration,
loadNextPage,
searchSongs,
searchQuery,
refresh
searchQuery
} = usePaginatedSongs({ pageSize: 100, playlistName: currentPlaylist });
// Export library to XML
@ -661,12 +660,7 @@ const RekordboxReader: React.FC = () => {
/>
{/* Background Job Progress */}
<BackgroundJobProgress
onTickWhileS3Sync={() => {
// Light refresh to pick up newly set hasS3File flags promptly
refresh();
}}
/>
<BackgroundJobProgress />
</Box>
);
};

View File

@ -45,15 +45,12 @@ interface BackgroundJobProgressProps {
jobId?: string;
onJobComplete?: (result: any) => void;
onJobError?: (error: string) => void;
// Called on each polling tick while an S3 sync job is running
onTickWhileS3Sync?: () => void;
}
export const BackgroundJobProgress: React.FC<BackgroundJobProgressProps> = ({
jobId,
onJobComplete,
onJobError,
onTickWhileS3Sync,
}) => {
const [jobs, setJobs] = useState<JobProgress[]>([]);
const [loading, setLoading] = useState(false);
@ -113,11 +110,6 @@ export const BackgroundJobProgress: React.FC<BackgroundJobProgressProps> = ({
if (jobId) {
updateJobProgress(jobId);
}
// Notify consumer while an S3 sync is running (to refresh song list, etc.)
if (onTickWhileS3Sync && activeJobs.some(j => j.type === 's3-sync')) {
onTickWhileS3Sync();
}
}, 2000); // Poll every 2 seconds for less frequent updates
};