Try other option for camera error

This commit is contained in:
Marvin Sextro 2021-07-25 02:25:39 +02:00
parent d93801501e
commit dc01566096
1 changed files with 8 additions and 1 deletions

View File

@ -70,7 +70,14 @@ function Form(): JSX.Element {
// Show camera view
async function showCameraView() {
// Create new QR Code Reader
const codeReader = new BrowserQRCodeReader();
let codeReader: BrowserQRCodeReader;
try {
codeReader = new BrowserQRCodeReader();
} catch (e) {
setErrorMessage('noCameraAccess');
return;
}
// Needs to be called before any camera can be accessed
let deviceList: MediaDeviceInfo[];