Skip to content

Commit

Permalink
Qrscanner_issue_fix
Browse files Browse the repository at this point in the history
Signed-off-by: Kumar M <pkumarm@deloitte.com>
  • Loading branch information
pkumarmshetty committed Jul 24, 2024
1 parent 78426b1 commit 30a99a8
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
16 changes: 16 additions & 0 deletions inji-verify/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions inji-verify/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"@types/redux-thunk": "^2.1.0",
"@yudiel/react-qr-scanner": "2.0.0-beta.3",
"patch-package": "^8.0.0",
"qr-scanner": "^1.4.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-icons": "^5.2.1",
Expand Down
7 changes: 5 additions & 2 deletions inji-verify/src/utils/qr-utils.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import { scanFile } from "@openhealthnz-credentials/pdf-image-qr-scanner";
import {decode, generateQRData} from '@mosip/pixelpass';
import {HEADER_DELIMITER, SUPPORTED_QR_HEADERS} from "./config";
import QrScanner from 'qr-scanner';

export const scanFilesForQr = async (selectedFile) => {
let scanResult = { data: null, error: null };
try {
scanResult.data = await scanFile(selectedFile);
const data = await QrScanner.scanImage(selectedFile)
.then(result => result)
.catch(error => console.log(error || 'No QR code found.'));
scanResult.data = data;
} catch (e) {
// Example Error Handling
if (e?.name === "InvalidPDFException") {
Expand Down

0 comments on commit 30a99a8

Please sign in to comment.