I don't know

This commit is contained in:
2024-04-09 23:35:19 -04:00
parent a51e96ea6e
commit 0aae7f9361

View File

@@ -121,7 +121,7 @@ var errorCallback = function(error: any) {
// } // }
function handle_start_qr_scanning() { async function handle_start_qr_scanning() {
console.log('*** handle_start_qr_scanning() ***'); console.log('*** handle_start_qr_scanning() ***');
if (user_media_status == 'denied') { if (user_media_status == 'denied') {
@@ -150,14 +150,10 @@ function handle_start_qr_scanning() {
); );
} }
// if (html5_qr_code.getState() == Html5QrcodeScannerState.NOT_STARTED) { if (html5_qr_code.getState() == Html5QrcodeScannerState.NOT_STARTED) {
// // console.log('Scanner is not started'); // console.log('Scanner is not started');
// } else {
// console.log('Scanner is already started');
// return;
// }
html5_qr_code.start({ facingMode: qr_facing_mode }, qr_scan_cfg, handle_qr_scan_success, handle_qr_scan_error) return await html5_qr_code.start({ facingMode: qr_facing_mode }, qr_scan_cfg, handle_qr_scan_success, handle_qr_scan_error)
.then((ignore: any) => { .then((ignore: any) => {
console.log('Scanning has started'); console.log('Scanning has started');
scanning_status = 'scanning'; scanning_status = 'scanning';
@@ -177,6 +173,14 @@ function handle_start_qr_scanning() {
return false; return false;
}); });
} else {
console.log('Scanner is already started');
return;
}
} }