diff options
author | Ivan Chen <ivan@tagg.id> | 2021-06-29 16:32:19 -0400 |
---|---|---|
committer | Ivan Chen <ivan@tagg.id> | 2021-06-29 16:32:19 -0400 |
commit | f6fdd5d913c29855644f226d09d6cba60faf6e21 (patch) | |
tree | 00c19638c10b3ebbd3c8697070f0818ec792fc15 | |
parent | 5fcffd40746b2074d523f53dc82c824d147444e5 (diff) |
Add error handling
-rw-r--r-- | src/components/camera/GalleryIcon.tsx | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/components/camera/GalleryIcon.tsx b/src/components/camera/GalleryIcon.tsx index 19a63a9a..ab226323 100644 --- a/src/components/camera/GalleryIcon.tsx +++ b/src/components/camera/GalleryIcon.tsx @@ -25,12 +25,14 @@ export const GalleryIcon: React.FC<GalleryIconProps> = ({ <TouchableOpacity onPress={() => navigateToImagePicker(navigation, screenType, title)} style={styles.saveButton}> - <Image - source={{uri: mostRecentPhoto}} - width={40} - height={40} - style={styles.galleryIcon} - /> + {mostRecentPhoto !== '' && ( + <Image + source={{uri: mostRecentPhoto}} + width={40} + height={40} + style={styles.galleryIcon} + /> + )} <Text style={styles.saveButtonLabel}>Gallery</Text> </TouchableOpacity> ); |