mirror of
https://github.com/Frooodle/Stirling-PDF.git
synced 2026-04-22 23:08:53 +02:00
Fix encrypted PDF unlock modal missing on IndexedDB restore and large files (#6099)
This commit is contained in:
@@ -391,8 +391,15 @@ export async function addFiles(
|
||||
let thumbnail: string | undefined;
|
||||
|
||||
if (targetFile.type.startsWith("application/pdf")) {
|
||||
processedFileMetadata = await generateProcessedFileMetadata(targetFile);
|
||||
thumbnail = processedFileMetadata?.thumbnailUrl;
|
||||
if (fileStub.processedFile?.isEncrypted) {
|
||||
// Pre-dispatch detection already flagged this PDF as encrypted; PDF.js
|
||||
// can't produce thumbnails/metadata without the password, so re-parsing
|
||||
// here would just duplicate work. Metadata is refreshed after unlock.
|
||||
processedFileMetadata = fileStub.processedFile;
|
||||
} else {
|
||||
processedFileMetadata = await generateProcessedFileMetadata(targetFile);
|
||||
thumbnail = processedFileMetadata?.thumbnailUrl;
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
const { generateThumbnailForFile } = await import("@app/utils/thumbnailUtils");
|
||||
|
||||
Reference in New Issue
Block a user