Fix cropper crashing after clicking cancel
parent
ae26963b45
commit
ebd333b331
|
@ -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'))
|
||||
}
|
||||
},
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue