|
|
@@ -75,6 +75,7 @@ export default class QRScan extends Component {
|
|
|
}
|
|
|
|
|
|
scanResult = (codes) => {
|
|
|
+ console.log("scanResult", this.scaning);
|
|
|
if (this.scaning) {
|
|
|
return;
|
|
|
}
|
|
|
@@ -83,9 +84,6 @@ export default class QRScan extends Component {
|
|
|
this.setState({
|
|
|
isResult: true
|
|
|
}, () => {
|
|
|
- setTimeout(() => {
|
|
|
- this.scaning = false;
|
|
|
- }, 500);
|
|
|
const msg = codes[0]
|
|
|
this.getQrMessage(msg?.value);
|
|
|
});
|
|
|
@@ -121,11 +119,13 @@ export default class QRScan extends Component {
|
|
|
message: 'It\'s not a legal QR code',
|
|
|
showCancel: false,
|
|
|
callback: (e) => {
|
|
|
+ this.scaning = false;
|
|
|
this.setState({
|
|
|
isResult: false
|
|
|
});
|
|
|
},
|
|
|
onBackPress: btn => {
|
|
|
+ this.scaning = false;
|
|
|
Dialog.dismissDialog();
|
|
|
this.setState({
|
|
|
isResult: false
|
|
|
@@ -169,8 +169,11 @@ export default class QRScan extends Component {
|
|
|
isResult: false
|
|
|
});
|
|
|
}
|
|
|
- });
|
|
|
- })
|
|
|
+ })
|
|
|
+ }).finally(() => {
|
|
|
+ this.scaning = false;
|
|
|
+ console.log("this.scaning", this.scaning);
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
switchFlash() {
|