mirror of
https://github.com/iib0011/omni-tools.git
synced 2025-09-20 06:29:32 +02:00
fix: missing previews
This commit is contained in:
@@ -33,17 +33,14 @@ export default function BaseFileInput({
|
||||
const { showSnackBar } = useContext(CustomSnackBarContext);
|
||||
|
||||
useEffect(() => {
|
||||
try {
|
||||
if (isArray(value)) {
|
||||
const objectUrl = createObjectURL(value[0]);
|
||||
if (value) {
|
||||
try {
|
||||
const objectUrl = createObjectURL(value);
|
||||
setPreview(objectUrl);
|
||||
|
||||
return () => revokeObjectURL(objectUrl);
|
||||
} else {
|
||||
setPreview(null);
|
||||
} catch (error) {
|
||||
console.error('Error previewing file:', error);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Error previewing file:', error);
|
||||
}
|
||||
}, [value]);
|
||||
|
||||
|
@@ -37,7 +37,6 @@ export async function protectPdf(
|
||||
password: options.password
|
||||
};
|
||||
const protectedFileUrl: string = await protectWithGhostScript(dataObject);
|
||||
console.log('protected', protectedFileUrl);
|
||||
return await loadPDFData(
|
||||
protectedFileUrl,
|
||||
pdfFile.name.replace('.pdf', '-protected.pdf')
|
||||
|
Reference in New Issue
Block a user