Fix cropper crashing after clicking cancel

zio/stable
Piotr P 2024-04-27 14:21:52 +02:00
parent ae26963b45
commit ebd333b331
1 changed files with 1 additions and 3 deletions

View File

@ -13,15 +13,13 @@ export async function openCamera(_opts: CameraOpts): Promise<RNImage> {
export async function openCropper(opts: CropperOptions): Promise<RNImage> {
// TODO handle more opts
return new Promise((resolve, reject) => {
return new Promise(resolve => {
unstable__openModal({
name: 'crop-image',
uri: opts.path,
onSelect: (img?: RNImage) => {
if (img) {
resolve(img)
} else {
reject(new Error('Canceled'))
}
},
})