diff options
author | Ivan Chen <ivan@tagg.id> | 2021-07-22 18:13:08 -0400 |
---|---|---|
committer | Ivan Chen <ivan@tagg.id> | 2021-07-22 18:13:08 -0400 |
commit | 8181eacc003342fc6bff649b8d1bd793a88efee5 (patch) | |
tree | 9634355ea571cec476c24d712a69efd9a1419533 /src/screens/profile/CaptionScreen.tsx | |
parent | 8100e6a9cff95227778158d2bdc870f32caa72d4 (diff) |
Handle error case for displaying alert, Add logic to auto reload
Diffstat (limited to 'src/screens/profile/CaptionScreen.tsx')
-rw-r--r-- | src/screens/profile/CaptionScreen.tsx | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/src/screens/profile/CaptionScreen.tsx b/src/screens/profile/CaptionScreen.tsx index 88ff0ecc..6ba1791c 100644 --- a/src/screens/profile/CaptionScreen.tsx +++ b/src/screens/profile/CaptionScreen.tsx @@ -34,13 +34,7 @@ import { } from '../../constants/strings'; import * as RootNavigation from '../../RootNavigation'; import {MainStackParams} from '../../routes'; -import { - handlePresignedURL, - handleVideoUpload, - patchMoment, - postMoment, - postMomentTags, -} from '../../services'; +import {patchMoment, postMoment, postMomentTags} from '../../services'; import { handleVideoMomentUpload, loadUserMoments, @@ -136,11 +130,7 @@ const CaptionScreen: React.FC<CaptionScreenProps> = ({route, navigation}) => { navigation.popToTop(); RootNavigation.navigate('ProfileTab'); setTimeout(() => { - if (isMediaAVideo) { - Alert.alert( - 'Beautiful, the Moment was uploaded successfully! Check back in a bit and refresh to see it!', - ); - } else { + if (!isMediaAVideo) { Alert.alert(SUCCESS_PIC_UPLOAD); } }, 500); @@ -182,6 +172,7 @@ const CaptionScreen: React.FC<CaptionScreenProps> = ({route, navigation}) => { ); } else { handleFailed(); + return; } } else { const momentResponse = await postMoment( @@ -330,6 +321,7 @@ const CaptionScreen: React.FC<CaptionScreenProps> = ({route, navigation}) => { media: { uri: mediaUri, isVideo: isMediaAVideo, + videoDuration, }, selectedTags: tags, }) |