wishlist modal bug fix

This commit is contained in:
Broque Thomas 2025-11-12 19:29:41 -08:00
parent abbb93f053
commit eaa27038d9

View file

@ -2505,7 +2505,9 @@ async function rehydrateModal(processInfo, userRequested = false) {
console.log(`✅ [Rehydrate] Successfully updated existing wishlist modal for auto-process`);
} else {
console.log(`💧 [Rehydrate] Creating new wishlist modal for active process: ${batch_id}`);
// Only create modal if user requested it - don't create for background auto-processing
if (userRequested) {
console.log(`💧 [Rehydrate] User requested - creating wishlist modal for active process: ${batch_id}`);
// Create the modal with current server state
await openDownloadMissingWishlistModal();
@ -2529,16 +2531,15 @@ async function rehydrateModal(processInfo, userRequested = false) {
// Start polling for live updates
startModalDownloadPolling(playlist_id);
// SIMPLIFIED VISIBILITY LOGIC: Show modal if user requested it, otherwise keep hidden for background sync
if (userRequested) {
// Show modal
console.log('👤 [Rehydrate] User requested - showing wishlist modal');
process.modalElement.style.display = 'flex';
WishlistModalState.setVisible();
WishlistModalState.clearUserClosed();
} else {
console.log('🔄 [Rehydrate] Background sync - keeping modal hidden until user interaction');
process.modalElement.style.display = 'none';
WishlistModalState.setHidden();
console.log('🔄 [Rehydrate] Background auto-processing detected - NOT creating modal (user must click wishlist button to see progress)');
// Don't create modal for background auto-processing
// User must click the wishlist button to see the modal
}
}
return;