Skip to content

Commit

Permalink
help
Browse files Browse the repository at this point in the history
  • Loading branch information
Kasra-G committed Feb 9, 2024
1 parent 5519820 commit cc4a18e
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions projects/mybyte/pages/qrRead.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,10 @@ export default function QrRead(props: any) {
outcomeMessage = error.message;
}
} finally {
window.alert(outcomeMessage);
setStatus(outcomeMessage);
pauseScanner()
window.alert(outcomeMessage);
resumeScanner()
}
};
return (
Expand All @@ -172,15 +174,12 @@ export default function QrRead(props: any) {
qrCodeSuccessCallback={async (decodedText: string, decodedResult: any) => {
if (ref.current == null || ref.current?.html5QrcodeScanner == null) return
if (data === decodedText) return;
pauseScanner()
if (decodedText.includes("/")) {
window.alert("Not valid User QR-Code");
resumeScanner()
return;
} // https://stackoverflow.com/questions/52850099/what-is-the-reg-expression-for-firestore-constraints-on-document-ids
setData(decodedText);
await determineAction(decodedText);
resumeScanner()
}}
/>
<span>Status: {status} </span>
Expand Down

0 comments on commit cc4a18e

Please sign in to comment.