From 86095cba5c624943c837b6b997f9485411444b01 Mon Sep 17 00:00:00 2001 From: enes Date: Tue, 20 Aug 2024 10:28:48 +0200 Subject: [PATCH] fix(files): show other file types in content for create, fix sign and verify error --- src/pages/sign/index.tsx | 7 +++++-- src/pages/verify/index.tsx | 12 ++++++++---- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/pages/sign/index.tsx b/src/pages/sign/index.tsx index b8cfe5c..f8f6163 100644 --- a/src/pages/sign/index.tsx +++ b/src/pages/sign/index.tsx @@ -416,8 +416,11 @@ export const SignPage = () => { ) if (arrayBuffer) { - files[fileName] = await convertToPdfFile(arrayBuffer, fileName) - + try { + files[fileName] = await convertToPdfFile(arrayBuffer, fileName) + } catch (error) { + console.error('Not a .pdf file:', error) + } const hash = await getHash(arrayBuffer) if (hash) { fileHashes[fileName] = hash diff --git a/src/pages/verify/index.tsx b/src/pages/verify/index.tsx index c67c2fc..202064b 100644 --- a/src/pages/verify/index.tsx +++ b/src/pages/verify/index.tsx @@ -246,10 +246,14 @@ export const VerifyPage = () => { ) if (arrayBuffer) { - files[fileName] = await convertToPdfFile( - arrayBuffer, - fileName! - ) + try { + files[fileName] = await convertToPdfFile( + arrayBuffer, + fileName! + ) + } catch (error) { + console.error('Not a .pdf file:', error) + } const hash = await getHash(arrayBuffer) if (hash) {