From ebd333b331d7103322d4e0a1c6f5035c0b22bdd9 Mon Sep 17 00:00:00 2001
From: Piotr P <piotr.palek@housecallpro.com>
Date: Sat, 27 Apr 2024 14:21:52 +0200
Subject: Fix cropper crashing after clicking cancel

---
 src/lib/media/picker.web.tsx | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

(limited to 'src/lib/media/picker.web.tsx')

diff --git a/src/lib/media/picker.web.tsx b/src/lib/media/picker.web.tsx
index 7e2562e29..70e28838b 100644
--- a/src/lib/media/picker.web.tsx
+++ b/src/lib/media/picker.web.tsx
@@ -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'))
         }
       },
     })
-- 
cgit 1.4.1

