Bug fix for QR scan. Clean up for the day!
This commit is contained in:
@@ -39,7 +39,7 @@ let disable_submit_badge_id_btn: boolean = true;
|
||||
|
||||
const dispatch = createEventDispatcher();
|
||||
|
||||
let html5_qr_code: null|string = null;
|
||||
let html5_qr_code: any|null|string = null;
|
||||
// let html5_qr_code = new Html5Qrcode(
|
||||
// 'qr_scanner_viewfinder', { formatsToSupport: [ Html5QrcodeSupportedFormats.QR_CODE ] }
|
||||
// );
|
||||
@@ -66,18 +66,21 @@ onMount(() => {
|
||||
onDestroy(() => {
|
||||
console.log('** Element Destroyed: ** QR Scanner');
|
||||
|
||||
qr_scan_result = null;
|
||||
qr_found_text = null;
|
||||
|
||||
handle_stop_qr_scanning();
|
||||
});
|
||||
|
||||
|
||||
var successCallback = function(error) {
|
||||
var successCallback = function(error: any) {
|
||||
console.log('Camera access allowed');
|
||||
|
||||
dispatch('qr_camera', {
|
||||
status: 'allowed',
|
||||
});
|
||||
};
|
||||
var errorCallback = function(error) {
|
||||
var errorCallback = function(error: any) {
|
||||
if (error.name == 'NotAllowedError') {
|
||||
console.log('Camera access not allowed!');
|
||||
|
||||
@@ -125,7 +128,7 @@ function handle_start_qr_scanning() {
|
||||
// return;
|
||||
// }
|
||||
|
||||
html5_qr_code.start({ facingMode: qr_facing_mode }, qr_scan_cfg, handle_qr_scan_success, handle_qr_scan_error).then((ignore) => {
|
||||
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 true;
|
||||
|
||||
Reference in New Issue
Block a user