From b77a716e52fcc1e0c669ce59df1f063fb008a5ca Mon Sep 17 00:00:00 2001 From: Ivan Chen Date: Wed, 30 Jun 2021 17:32:56 -0400 Subject: Fix gallery repicking image bug --- src/screens/moments/CameraScreen.tsx | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) (limited to 'src') diff --git a/src/screens/moments/CameraScreen.tsx b/src/screens/moments/CameraScreen.tsx index 4ca79c4f..d9278876 100644 --- a/src/screens/moments/CameraScreen.tsx +++ b/src/screens/moments/CameraScreen.tsx @@ -16,11 +16,7 @@ import { } from '../../components'; import {MainStackParams} from '../../routes'; import {HeaderHeight, normalize, SCREEN_WIDTH} from '../../utils'; -import { - navigateToImagePicker, - showGIFFailureAlert, - takePicture, -} from '../../utils/camera'; +import {showGIFFailureAlert, takePicture} from '../../utils/camera'; type CameraScreenRouteProps = RouteProp; export type CameraScreenNavigationProps = StackNavigationProp< @@ -148,19 +144,17 @@ const CameraScreen: React.FC = ({route, navigation}) => { ) : ( - navigateToImagePicker((pic) => { - const filename = pic.filename; - if ( - filename && - (filename.endsWith('gif') || filename.endsWith('GIF')) - ) { - showGIFFailureAlert(() => navigateToCropper(pic.path)); - } else { - navigateToCropper(pic.path); - } - }) - } + callback={(pic) => { + const filename = pic.filename; + if ( + filename && + (filename.endsWith('gif') || filename.endsWith('GIF')) + ) { + showGIFFailureAlert(() => navigateToCropper(pic.path)); + } else { + navigateToCropper(pic.path); + } + }} /> )} -- cgit v1.2.3-70-g09d2