You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 12, 2023. It is now read-only.
When scanning a QR code, it keeps on repeating the scan process. As a result, it keeps giving the same result multiple times as well and keep on vibrating.
What's happening?
When scanning a QR code, if the camera is kept pointed at the qr code, it keeps on scanning for multiple times
How can it be reproduced?
Keep the camera pointed at a specific QR code and do not move the phone
Build details?
1.4.1
The text was updated successfully, but these errors were encountered:
ZAT90
changed the title
Keep scanning same qr code multiple times
Keeps repeating scanning same qr code multiple times
Jan 31, 2023
When scanning a QR code, it keeps on repeating the scan process. As a result, it keeps giving the same result multiple times as well and keep on vibrating.
What's happening?
When scanning a QR code, if the camera is kept pointed at the qr code, it keeps on scanning for multiple times
How can it be reproduced?
Keep the camera pointed at a specific QR code and do not move the phone
Build details?
1.4.1
Hi, I have a possible solution for this issue. You can use a debounce function to limit the number of calls to the onBarCodeRead method and Please let me know if it solves your problem. Here is the code:
// Import debounce from lodashimportdebouncefrom'lodash.debounce';// Define your onBarCodeRead functionconstonBarCodeRead=(event)=>{// Do something with the event objectconsole.log(event.type,event.data);};// Define a debounced version of your onBarCodeRead function using React.useCallback hookconstdebouncedOnBarCodeRead=React.useCallback(debounce(onBarCodeRead,1000),[]);// Pass the debouncedOnBarCodeRead function as a prop to the QRCodeScanner component<QRCodeScanneronBarCodeRead={debouncedOnBarCodeRead}/>```
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
When scanning a QR code, it keeps on repeating the scan process. As a result, it keeps giving the same result multiple times as well and keep on vibrating.
What's happening?
When scanning a QR code, if the camera is kept pointed at the qr code, it keeps on scanning for multiple times
How can it be reproduced?
Keep the camera pointed at a specific QR code and do not move the phone
Build details?
1.4.1
The text was updated successfully, but these errors were encountered: