mirror of
https://github.com/arsvendg/Stirling-PDF.git
synced 2026-07-16 11:23:10 +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;
|
let thumbnail: string | undefined;
|
||||||
|
|
||||||
if (targetFile.type.startsWith("application/pdf")) {
|
if (targetFile.type.startsWith("application/pdf")) {
|
||||||
processedFileMetadata = await generateProcessedFileMetadata(targetFile);
|
if (fileStub.processedFile?.isEncrypted) {
|
||||||
thumbnail = processedFileMetadata?.thumbnailUrl;
|
// 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 {
|
} else {
|
||||||
try {
|
try {
|
||||||
const { generateThumbnailForFile } = await import("@app/utils/thumbnailUtils");
|
const { generateThumbnailForFile } = await import("@app/utils/thumbnailUtils");
|
||||||
|
|||||||
Reference in New Issue
Block a user