diff options
Diffstat (limited to 'src/utils/camera.ts')
-rw-r--r-- | src/utils/camera.ts | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/src/utils/camera.ts b/src/utils/camera.ts index e5eba5f8..0be4d27c 100644 --- a/src/utils/camera.ts +++ b/src/utils/camera.ts @@ -48,9 +48,7 @@ export const navigateToImagePicker = (callback: (pic: Image) => void) => { mediaType: 'photo', }) .then((pic) => { - if (pic.path && pic.filename) { - callback(pic); - } + callback(pic); }) .catch((err) => { if (err.code && err.code !== 'E_PICKER_CANCELLED') { @@ -81,3 +79,28 @@ export const navigateToVideoPicker = (callback: (vid: Video) => void) => { } }); }; + +export const showGIFFailureAlert = (onSuccess: () => void) => + Alert.alert( + 'Warning', + 'The app currently cannot handle GIFs, and will only save a static image.', + [ + { + text: 'Cancel', + onPress: () => {}, + style: 'cancel', + }, + { + text: 'Post', + onPress: onSuccess, + style: 'default', + }, + ], + { + cancelable: true, + onDismiss: () => + Alert.alert( + 'This alert was dismissed by tapping outside of the alert dialog.', + ), + }, + ); |