From 9ccf29897fccb9b53cc18adfa9cbd6ed4d5be5fb Mon Sep 17 00:00:00 2001 From: Elijah Date: Mon, 15 Jun 2026 16:29:33 -0700 Subject: [PATCH] Fix early return for PDF thumbnail in FileExplorer --- frontend/src/components/FileExplorer.tsx | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/frontend/src/components/FileExplorer.tsx b/frontend/src/components/FileExplorer.tsx index 3dc1678..d8720bb 100644 --- a/frontend/src/components/FileExplorer.tsx +++ b/frontend/src/components/FileExplorer.tsx @@ -1163,15 +1163,15 @@ export default function FileExplorer({ onLogout }: FileExplorerProps) { const isAudio = ['mp3', 'flac', 'wav', 'm4a', 'wma', 'aac'].includes(ext) || file.mime_type?.startsWith('audio/'); const isMedia = isImage || isVideo || isOffice || isAudio || ext === 'pdf'; - if (ext === 'pdf') { - return ( -
- PDF -
- ); - } - const fallbackIcon = (() => { + if (ext === 'pdf') { + return ( +
+ PDF +
+ ); + } + if (ext === 'docx' || ext === 'doc') { return (
@@ -1241,16 +1241,10 @@ export default function FileExplorer({ onLogout }: FileExplorerProps) { if (isMedia && file.checksum && viewMode === 'grid') { const docType = file.name.endsWith('.docx') ? 'docs' : file.name.endsWith('.pptx') ? 'slides' : (file.name.endsWith('.xlsx') || file.name.endsWith('.xls')) ? 'sheets' : ext === 'pdf' ? 'pdf' : null; - // Use fallbackIcon for PDF too so it shows "PDF" text while loading - const currentFallback = ext === 'pdf' ? ( -
- PDF -
- ) : fallbackIcon; return (
- +
); }