Skip to content

Commit

Permalink
Merge pull request #192 from ugahacks/feature/scanner_hotfix
Browse files Browse the repository at this point in the history
feature/scanner_hotfix
  • Loading branch information
Kasra-G authored Feb 9, 2024
2 parents 34b56fc + 3a4388b commit 5cf5017
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions projects/mybyte/pages/qrRead.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,7 @@ export default function QrRead(props: any) {
}
} finally {
setStatus(outcomeMessage);
pauseScanner()
window.alert(outcomeMessage);
resumeScanner()
}
};
return (
Expand All @@ -178,8 +176,12 @@ export default function QrRead(props: any) {
window.alert("Not valid User QR-Code");
return;
} // https://stackoverflow.com/questions/52850099/what-is-the-reg-expression-for-firestore-constraints-on-document-ids
pauseScanner()
setData(decodedText);
await determineAction(decodedText);
if (ref.current?.html5QrcodeScanner?.getState() === Html5QrcodeScannerState.PAUSED) {
await determineAction(decodedText);
resumeScanner()
}
}}
/>
<span>Status: {status} </span>
Expand Down

0 comments on commit 5cf5017

Please sign in to comment.