Fixes #6987 - Prevent ZXing from unnecessarily requesting camera access

This commit is contained in:
Stefan Ceriu
2022-10-27 12:56:49 +03:00
committed by Stefan Ceriu
parent 7daa4f121e
commit 33cf429526
@@ -106,7 +106,11 @@ class QRLoginService: NSObject, QRLoginServiceProtocol {
}
func stopScanning(destroy: Bool) {
zxCapture.delegate = nil
if (zxCapture.delegate != nil) {
// Setting the zxCapture to nil without checking makes it start
// scanning and implicitly requesting camera access
zxCapture.delegate = nil
}
guard zxCapture.running else {
return