Skip to content
Snippets Groups Projects
Commit 63aba5b7 authored by Reiter, Christoph's avatar Reiter, Christoph :snake:
Browse files

Handle the case of no video device being found

Instead of throwing an error set activeCamera to its initial value.
parent df66f70f
Branches
No related tags found
1 merge request!3Handle the case of no video device being found
Pipeline #13456 passed
......@@ -112,7 +112,7 @@ export class QrCodeScanner extends ScopedElementsMixin(DBPLitElement) {
if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
that.activeCamera = 'environment';
} else {
that.activeCamera = Array.from(devices_map)[0][0];
that.activeCamera = devices_map.size ? Array.from(devices_map)[0][0] : '';
}
......@@ -141,7 +141,7 @@ export class QrCodeScanner extends ScopedElementsMixin(DBPLitElement) {
if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
that.activeCamera = 'environment';
} else {
that.activeCamera = Array.from(devices_map)[0][0];
that.activeCamera = devices_map.size ? Array.from(devices_map)[0][0] : '';
}
resolve(results);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment