JodusNodus / react-qr-reader

React component for reading QR codes from webcam.
https://jodusnodus.github.io/react-qr-reader
MIT License
1.13k stars 406 forks source link

Stop scanning #211

Open samaneh-kamalian opened 2 years ago

samaneh-kamalian commented 2 years ago

First, I initiate react-qr-reader with delay 3000. when user scan a code, I setState this delay to false to stop scanning and showing a dialog to user. when user press ok button in dialog, scanning qrcode must started again but the problem is that while dialog is open(and delay at this time is false), the scanning is done! But after two consecutive scans, the scan is no longer performed until the user presses the OK button. The problem is only the beginning I checked my code a lot and there is a simple code. Isn't this a problem with your library?

samaneh-kamalian commented 2 years ago

First, I initiate react-qr-reader with delay 3000. when user scan a code, I setState this delay to false to stop scanning and showing a dialog to user. when user press ok button in dialog, scanning qrcode must started again but the problem is that while dialog is open(and delay at this time is false), the scanning is done! But after two consecutive scans, the scan is no longer performed until the user presses the OK button. The problem is only the beginning I checked my code a lot and there is a simple code. Isn't this a problem with your library?

Any solution? I really stopped on it