Skip to content

Commit aef6882

Browse files
committed
Add comments in the code explaining the reloading
1 parent 5c03e69 commit aef6882

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/components/Utilities/QRCamera.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,10 @@ function switchCamera() {
8383
console.log(cameraStore.cameraDevices)
8484
console.log('switchCamera: cameraDevices.value = ' + cameraStore.cameraDevices.value)
8585
console.log('camerastore.cameradevices.length = ' + cameraStore.cameraDevices.length)
86+
// when access is not granted, the cameraStore contains only one entry
87+
// with an empty id, no more information is provided
88+
// In this case, since we are here already and access is granted, reload the
89+
// set of available cameras so that we can switch to the back facing one.
8690
if (cameraStore.cameraDevices.length === 1 && cameraStore.cameraDevices[0].id == "") {
8791
console.log("No cameras found in cameraStore, re-enumerating them")
8892
updateAvailableCamera()

0 commit comments

Comments
 (0)