diff --git a/components/Form.tsx b/components/Form.tsx index 67bf46c..cecb600 100644 --- a/components/Form.tsx +++ b/components/Form.tsx @@ -106,7 +106,7 @@ function Form(): JSX.Element { // Add event listener to listen for file change events useEffect(() => { if (inputFile && inputFile.current) { - inputFile.current.addEventListener('input', () => { + inputFile.current.addEventListener('change', () => { let selectedFile = inputFile.current.files[0]; if (selectedFile !== undefined) { setQrCode(undefined); diff --git a/src/process.ts b/src/process.ts index 0191ff1..60af42e 100644 --- a/src/process.ts +++ b/src/process.ts @@ -1,5 +1,5 @@ import {PayloadBody, Receipt} from "./payload"; -import * as PdfJS from 'pdfjs-dist' +import * as PdfJS from 'pdfjs-dist/legacy/build/pdf' import {COLORS} from "./colors"; import { getCertificatesInfoFromPDF } from "@ninja-labs/verify-pdf"; // ES6 import * as Sentry from '@sentry/react';