Fix encrypted pdf handling (#6088)

Fix and improve encrypted pdf handling
This commit is contained in:
Reece Browne
2026-04-13 13:20:43 +01:00
committed by GitHub
parent d53beb9bce
commit 76aa5c7e2f
12 changed files with 527 additions and 67 deletions
@@ -9,8 +9,10 @@ interface EncryptedPdfUnlockModalProps {
password: string;
errorMessage?: string | null;
isProcessing: boolean;
remainingCount: number;
onPasswordChange: (value: string) => void;
onUnlock: () => void;
onUnlockAll: () => void;
onSkip: () => void;
}
@@ -20,8 +22,10 @@ const EncryptedPdfUnlockModal = ({
password,
errorMessage,
isProcessing,
remainingCount,
onPasswordChange,
onUnlock,
onUnlockAll,
onSkip,
}: EncryptedPdfUnlockModalProps) => {
const { t } = useTranslation();
@@ -75,9 +79,16 @@ const EncryptedPdfUnlockModal = ({
<Button variant="light" color="var(--mantine-color-gray-8)" onClick={onSkip} disabled={isProcessing}>
{t("encryptedPdfUnlock.skip", "Skip for now")}
</Button>
<Button onClick={onUnlock} loading={isProcessing} disabled={password.trim().length === 0}>
{t("encryptedPdfUnlock.unlock", "Unlock & Continue")}
</Button>
<Group gap="xs">
{remainingCount > 0 && (
<Button variant="light" onClick={onUnlockAll} loading={isProcessing} disabled={password.trim().length === 0}>
{t("encryptedPdfUnlock.unlockAll", "Use for all ({{count}})", { count: remainingCount + 1 })}
</Button>
)}
<Button onClick={onUnlock} loading={isProcessing} disabled={password.trim().length === 0}>
{t("encryptedPdfUnlock.unlock", "Unlock & Continue")}
</Button>
</Group>
</Group>
</Stack>
</Modal>