diff --git a/frontend/src/components/admin/AdminAuthenticatedImage.tsx b/frontend/src/components/admin/AdminAuthenticatedImage.tsx index c0a3b20..99526b7 100644 --- a/frontend/src/components/admin/AdminAuthenticatedImage.tsx +++ b/frontend/src/components/admin/AdminAuthenticatedImage.tsx @@ -36,23 +36,7 @@ export const AdminAuthenticatedImage: React.FC = ( setLoading(false); } } catch (err: any) { - console.error('Failed to load image:', src, err); - // Log more details about the error - if (err.response) { - console.error('Response status:', err.response.status); - console.error('Response headers:', err.response.headers); - if (err.response.data instanceof Blob) { - // Try to read error message from blob - try { - const text = await err.response.data.text(); - console.error('Response data:', text); - } catch (e) { - console.error('Could not read blob data'); - } - } else { - console.error('Response data:', err.response.data); - } - } + // Image loading failed - handled by error state if (!cancelled) { setError(true); setLoading(false); diff --git a/frontend/src/components/common/AuthenticatedImage.tsx b/frontend/src/components/common/AuthenticatedImage.tsx index cc6b8b9..111e87a 100644 --- a/frontend/src/components/common/AuthenticatedImage.tsx +++ b/frontend/src/components/common/AuthenticatedImage.tsx @@ -46,7 +46,7 @@ export const AuthenticatedImage: React.FC = ({ } if (!token) { - console.warn('No auth token found for image:', src); + // No auth token - use fallback setImageSrc(fallbackSrc || ''); setIsLoading(false); return; @@ -69,7 +69,7 @@ export const AuthenticatedImage: React.FC = ({ ? buildResourceUrl(imageUrl) : imageUrl; - // console.log('Fetching authenticated image:', fullImageUrl); + // Fetch authenticated image const response = await fetch(fullImageUrl, { headers: { 'Authorization': `Bearer ${token}` @@ -85,7 +85,7 @@ export const AuthenticatedImage: React.FC = ({ setImageSrc(objectUrl); setIsLoading(false); } catch (err) { - console.error('Failed to load image:', src, err); + // Image loading failed - use fallback setError(true); setImageSrc(fallbackSrc || ''); setIsLoading(false); diff --git a/frontend/src/components/gallery/GalleryView.tsx b/frontend/src/components/gallery/GalleryView.tsx index 8a783fe..a210164 100644 --- a/frontend/src/components/gallery/GalleryView.tsx +++ b/frontend/src/components/gallery/GalleryView.tsx @@ -54,16 +54,7 @@ export const GalleryView: React.FC = ({ slug, event }) => { // Fetch photos const { data, isLoading, error, refetch } = useGalleryPhotos(slug); - // Debug logging - useEffect(() => { - console.log('Event prop:', event); - console.log('Event prop hero_photo_id:', event?.hero_photo_id); - if (data) { - console.log('Gallery data:', data); - console.log('Event data from API:', data.event); - console.log('Hero photo ID from API:', data.event?.hero_photo_id); - } - }, [data, event]); + // Data updates are handled by React Query const downloadAllMutation = useDownloadAllPhotos(); // Handle window resize @@ -124,7 +115,7 @@ export const GalleryView: React.FC = ({ slug, event }) => { } } } catch (e) { - console.error('Failed to parse event theme:', e); + // Invalid theme format - use default // Fall back to global theme if (settingsData.theme_config) { themeToApply = settingsData.theme_config; @@ -142,10 +133,10 @@ export const GalleryView: React.FC = ({ slug, event }) => { // If there's a hero photo, add it to gallery settings if (fullEvent.hero_photo_id && themeToApply.gallerySettings) { themeToApply.gallerySettings.heroImageId = fullEvent.hero_photo_id; - console.log('Setting hero photo ID in existing gallery settings:', fullEvent.hero_photo_id); + // Apply hero photo ID to existing gallery settings } else if (fullEvent.hero_photo_id) { themeToApply.gallerySettings = { heroImageId: fullEvent.hero_photo_id }; - console.log('Creating gallery settings with hero photo ID:', fullEvent.hero_photo_id); + // Create gallery settings with hero photo ID } setTheme(themeToApply); }, 0); @@ -368,11 +359,6 @@ export const GalleryView: React.FC = ({ slug, event }) => { headerExtra={(() => { const items = []; - console.log('Header extra - data loaded:', !!data); - console.log('Header extra - allow uploads:', data?.event?.allow_user_uploads); - console.log('Header extra - showSidebar:', showSidebar); - console.log('Header extra - isMobile:', isMobile); - if (daysUntilExpiration <= 1 && daysUntilExpiration > 0) { items.push( diff --git a/frontend/src/components/gallery/PhotoGrid.tsx b/frontend/src/components/gallery/PhotoGrid.tsx index ddd5388..934fd84 100644 --- a/frontend/src/components/gallery/PhotoGrid.tsx +++ b/frontend/src/components/gallery/PhotoGrid.tsx @@ -92,7 +92,7 @@ export const PhotoGrid: React.FC = ({ photos, slug, categoryId } const downloadPromises = selectedPhotosList.map(photo => galleryService.downloadPhoto(slug, photo.id, photo.filename) .catch(err => { - console.error(`Failed to download ${photo.filename}:`, err); + // Download failed - error handled by UI return null; }) ); diff --git a/frontend/src/components/gallery/PhotoGridWithLayouts.tsx b/frontend/src/components/gallery/PhotoGridWithLayouts.tsx index 4fd7b4a..647b767 100644 --- a/frontend/src/components/gallery/PhotoGridWithLayouts.tsx +++ b/frontend/src/components/gallery/PhotoGridWithLayouts.tsx @@ -115,7 +115,7 @@ export const PhotoGridWithLayouts: React.FC = ({ const downloadPromises = selectedPhotosList.map(photo => galleryService.downloadPhoto(slug, photo.id, photo.filename) .catch(err => { - console.error(`Failed to download ${photo.filename}:`, err); + // Download failed - error handled by UI return null; }) ); diff --git a/frontend/src/components/gallery/UserPhotoUpload.tsx b/frontend/src/components/gallery/UserPhotoUpload.tsx index c0bac77..d38b56b 100644 --- a/frontend/src/components/gallery/UserPhotoUpload.tsx +++ b/frontend/src/components/gallery/UserPhotoUpload.tsx @@ -79,7 +79,7 @@ export const UserPhotoUpload: React.FC = ({ }); successCount++; } catch (error: any) { - console.error(`Failed to upload ${file.name}:`, error); + // Upload error handled - user notified via UI failedCount++; // Show specific error message diff --git a/frontend/src/components/gallery/layouts/HeroGalleryLayout.tsx b/frontend/src/components/gallery/layouts/HeroGalleryLayout.tsx index 46d593b..1cd1e6f 100644 --- a/frontend/src/components/gallery/layouts/HeroGalleryLayout.tsx +++ b/frontend/src/components/gallery/layouts/HeroGalleryLayout.tsx @@ -47,12 +47,12 @@ export const HeroGalleryLayout: React.FC = ({ useEffect(() => { if (photos.length > 0) { const heroId = gallerySettings.heroImageId; - console.log('HeroGalleryLayout - heroImageId:', heroId, 'photos:', photos.length); + // Process hero layout with provided photos // If admin has selected a specific hero image, always use it if (heroId) { const adminSelectedHero = photos.find(p => p.id === heroId); - console.log('Looking for hero photo with ID:', heroId, 'Found:', adminSelectedHero?.filename); + // Hero photo selected by admin if (adminSelectedHero) { setHeroPhoto(adminSelectedHero); setHasInitialized(true); diff --git a/frontend/src/contexts/AdminAuthContext.tsx b/frontend/src/contexts/AdminAuthContext.tsx index 4a9e074..79133bd 100644 --- a/frontend/src/contexts/AdminAuthContext.tsx +++ b/frontend/src/contexts/AdminAuthContext.tsx @@ -44,7 +44,7 @@ export const AdminAuthProvider: React.FC = ({ children } setIsAuthenticated(true); } } catch (error) { - console.error('Auth check error:', error); + // Auth check failed - user needs to login setError('Failed to check authentication'); } finally { setIsLoading(false); diff --git a/frontend/src/contexts/GalleryAuthContext.tsx b/frontend/src/contexts/GalleryAuthContext.tsx index c6a906b..d1e2c26 100644 --- a/frontend/src/contexts/GalleryAuthContext.tsx +++ b/frontend/src/contexts/GalleryAuthContext.tsx @@ -75,7 +75,7 @@ export const GalleryAuthProvider: React.FC = ({ childr localStorage.removeItem(`gallery_token_${currentSlug}`); } } catch (error) { - console.error('Failed to parse stored event data'); + // Invalid stored data - clear it localStorage.removeItem(`gallery_event_${currentSlug}`); localStorage.removeItem(`gallery_token_${currentSlug}`); } diff --git a/frontend/src/pages/admin/AdminLoginPage.tsx b/frontend/src/pages/admin/AdminLoginPage.tsx index accb4a8..b626424 100644 --- a/frontend/src/pages/admin/AdminLoginPage.tsx +++ b/frontend/src/pages/admin/AdminLoginPage.tsx @@ -83,7 +83,7 @@ export const AdminLoginPage: React.FC = () => { toast.success('Login successful!'); setLoginSuccess(true); } catch (error: any) { - console.error('Login error:', error); + // Login error handled by UI notification // Handle network errors gracefully if (error.code === 'ERR_NETWORK' || error.code === 'ERR_CONNECTION_RESET') {