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() ***');
if (user_media_status == 'denied') {
@@ -150,33 +150,37 @@ function handle_start_qr_scanning() {
);
}
// if (html5_qr_code.getState() == Html5QrcodeScannerState.NOT_STARTED) {
// // console.log('Scanner is not started');
// } else {
// console.log('Scanner is already started');
// return;
// }
if (html5_qr_code.getState() == Html5QrcodeScannerState.NOT_STARTED) {
// console.log('Scanner is not started');
html5_qr_code.start({ facingMode: qr_facing_mode }, qr_scan_cfg, handle_qr_scan_success, handle_qr_scan_error)
.then((ignore: any) => {
console.log('Scanning has started');
scanning_status = 'scanning';
return await html5_qr_code.start({ facingMode: qr_facing_mode }, qr_scan_cfg, handle_qr_scan_success, handle_qr_scan_error)
.then((ignore: any) => {
console.log('Scanning has started');
scanning_status = 'scanning';
// let subject = 'QR Scanning Started';
// let message = ignore;
// send_init_confirm_email(subject, message);
// let subject = 'QR Scanning Started';
// let message = ignore;
// send_init_confirm_email(subject, message);
return true;
}).catch((err) => {
console.log('There was an error while trying to start the QR scanner');
scanning_status = 'start_error';
return true;
}).catch((err) => {
console.log('There was an error while trying to start the QR scanner');
scanning_status = 'start_error';
let subject = 'QR Scanning Start Error';
let message = err;
send_init_confirm_email(subject, message);
let subject = 'QR Scanning Start Error';
let message = err;
send_init_confirm_email(subject, message);
return false;
});
return false;
});
} else {
console.log('Scanner is already started');
return;
}
}