Handle camera cancellation (#11322)

This commit is contained in:
Samuel Newman
2026-08-03 16:25:42 +03:00
committed by GitHub
parent d58be1adea
commit c2ceb8057f
5 changed files with 25 additions and 19 deletions
+3 -3
View File
@@ -17,11 +17,11 @@ export async function openCamera(customOpts: ImagePickerOptions) {
}
const res = await launchCameraAsync(opts)
if (!res || !res.assets) {
throw new Error('Camera was closed before taking a photo')
if (res.canceled) {
return
}
const asset = res?.assets[0]
const asset = res.assets[0]
return {
path: asset.uri,