diff --git a/app.js b/app.js index cfe068f..9f717e7 100644 --- a/app.js +++ b/app.js @@ -1796,13 +1796,22 @@ function openFileViewer({ url, blob, mime }, filename, relpath) { const isImage = (mime || '').startsWith('image/'); const isPdf = (mime || '').includes('pdf') || /\.pdf$/i.test(filename); + console.log('[FILE] openFileViewer:', {filename, mime, isPdf, pdfjs: typeof pdfjs, blobSize: blob.size}); + if (isPdf && typeof pdfjs !== 'undefined') { + console.log('[FILE] → PDF-Viewer aufrufen'); openPdfViewer(blob, filename, relpath); return; } + if (isPdf && typeof pdfjs === 'undefined') { + console.warn('[FILE] PDF.js ist NICHT geladen!'); + showToast('⚠️ PDF.js nicht verfügbar, Download stattdessen', 'error'); + } + if (!isImage) { // Alles außer Bildern + PDFs: Download + console.log('[FILE] → Download-Fallback'); const a = document.createElement('a'); a.href = url; a.download = filename || 'download';