mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-10-02 22:06:50 +02:00
fix(barcode-scanner): early return scanner if missing permissions (#3221)
This commit is contained in:
1 parent
de6bf68585
commit
82fbb0c790
2 files changed
+11
No files matched your search
@@ -261,6 +261,11 @@ class BarcodeScannerPlugin: Plugin, AVCaptureMetadataOutputObjectsDelegate {
|
||||
}
|
||||
|
||||
private func runScanner(_ invoke: Invoke, args: ScanOptions) {
|
||||
if getPermissionState() != "granted" {
|
||||
invoke.reject("Camera permission denied or not yet requested")
|
||||
return
|
||||
}
|
||||
|
||||
scanFormats = [AVMetadataObject.ObjectType]()
|
||||
|
||||
(args.formats ?? []).forEach { format in
|
||||
|
||||
Reference in new issue
Block a user