mirror of
https://github.com/arsvendg/Stirling-PDF.git
synced 2026-07-16 11:23:10 +02:00
🤖 format everything with pre-commit by stirlingbot (#3882)
Auto-generated by [create-pull-request][1] with **stirlingbot** [1]: https://github.com/peter-evans/create-pull-request Signed-off-by: stirlingbot[bot] <stirlingbot[bot]@users.noreply.github.com> Co-authored-by: stirlingbot[bot] <195170888+stirlingbot[bot]@users.noreply.github.com>
This commit is contained in:
co-authored by
stirlingbot[bot] <195170888+stirlingbot[bot]@users.noreply.github.com>
parent
b4f8b896d1
commit
7fa5e130d9
@@ -226,7 +226,7 @@ function setupFileInput(chooser) {
|
||||
|
||||
try {
|
||||
const { isEncrypted, requiresPassword } = await decryptFile.checkFileEncrypted(file);
|
||||
if (file.type === 'application/pdf' && isEncrypted &&
|
||||
if (file.type === 'application/pdf' && isEncrypted &&
|
||||
!window.location.pathname.includes('remove-password')) {
|
||||
decryptedFile = await decryptFile.decryptFile(file, requiresPassword);
|
||||
if (!decryptedFile) throw new Error('File decryption failed.');
|
||||
@@ -236,13 +236,13 @@ function setupFileInput(chooser) {
|
||||
|
||||
} catch (error) {
|
||||
console.error(`Error decrypting file: ${file.name}`, error);
|
||||
|
||||
|
||||
// Check if this is a PDF corruption error
|
||||
if (error.message && error.message.includes('PDF file is corrupted')) {
|
||||
// The error banner is already shown by DecryptFiles.js, just continue with the file
|
||||
console.warn(`Continuing with corrupted PDF file: ${file.name}`);
|
||||
}
|
||||
|
||||
|
||||
if (!file.uniqueId) file.uniqueId = UUID.uuidv4();
|
||||
return file;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user