mirror of
https://github.com/arsvendg/Stirling-PDF.git
synced 2026-07-16 03:20:46 +02:00
Fix encrypted pdf handling (#6088)
Fix and improve encrypted pdf handling
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user