chore: Fix app
This commit is contained in:
@@ -17,12 +17,21 @@ export function shouldPreflightMobileCapturePermissions(runtime: RuntimePlatform
|
||||
return runtime === 'capacitor';
|
||||
}
|
||||
|
||||
/**
|
||||
* Only an explicit native denial blocks capture. Any other state (granted, a
|
||||
* dismissed prompt, or an unknown value) defers to the WebView getUserMedia
|
||||
* permission flow, which re-prompts through Capacitor's WebChromeClient.
|
||||
*/
|
||||
function isCaptureBlockedByNativeDenial(state: MobileMediaPermissionState | undefined): boolean {
|
||||
return state === 'denied';
|
||||
}
|
||||
|
||||
/** Resolve whether voice capture can proceed after a native permission request. */
|
||||
export function isVoiceCaptureAllowed(result: MobileCapturePermissionResult): boolean {
|
||||
return isMobileCapturePermissionGranted(result.microphone);
|
||||
return !isCaptureBlockedByNativeDenial(result.microphone);
|
||||
}
|
||||
|
||||
/** Resolve whether camera capture can proceed after a native permission request. */
|
||||
export function isCameraCaptureAllowed(result: MobileCapturePermissionResult): boolean {
|
||||
return isMobileCapturePermissionGranted(result.camera);
|
||||
return !isCaptureBlockedByNativeDenial(result.camera);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user