aboutsummaryrefslogtreecommitdiff
path: root/src/screens/moments/CameraScreen.tsx
diff options
context:
space:
mode:
authorIvan Chen <ivan@tagg.id>2021-07-29 16:34:50 -0400
committerIvan Chen <ivan@tagg.id>2021-07-29 16:34:50 -0400
commit18a1188a2a411e4bb042c922741fea1a5a3aa946 (patch)
tree28dde4f21a9bfb966c574be276b7eaa0f67848ed /src/screens/moments/CameraScreen.tsx
parent403314805c9192aa7f7adca9605a0d0a52997c9c (diff)
Add max duration constant, Add check for picking video duration, Add logic to cancel recording state
Diffstat (limited to 'src/screens/moments/CameraScreen.tsx')
-rw-r--r--src/screens/moments/CameraScreen.tsx5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/screens/moments/CameraScreen.tsx b/src/screens/moments/CameraScreen.tsx
index 40db1191..82ee66c0 100644
--- a/src/screens/moments/CameraScreen.tsx
+++ b/src/screens/moments/CameraScreen.tsx
@@ -9,7 +9,7 @@ import {CameraType, FlashMode, RNCamera} from 'react-native-camera';
import {AnimatedCircularProgress} from 'react-native-circular-progress';
import CloseIcon from '../../assets/ionicons/close-outline.svg';
import {FlashButton, FlipButton, GalleryIcon} from '../../components';
-import {TAGG_PURPLE} from '../../constants';
+import {MAX_VIDEO_RECORDING_DURATION, TAGG_PURPLE} from '../../constants';
import {MainStackParams} from '../../routes';
import {HeaderHeight, SCREEN_HEIGHT, SCREEN_WIDTH} from '../../utils';
import {showGIFFailureAlert, takePicture, takeVideo} from '../../utils/camera';
@@ -37,6 +37,7 @@ const CameraScreen: React.FC<CameraScreenProps> = ({route, navigation}) => {
navigation.dangerouslyGetParent()?.setOptions({
tabBarVisible: false,
});
+ return () => setIsRecording(false);
}, [navigation]),
);
@@ -136,7 +137,7 @@ const CameraScreen: React.FC<CameraScreenProps> = ({route, navigation}) => {
width={6}
fill={100}
rotation={0}
- duration={60000 + 1000} // an extra second for UI to load
+ duration={(MAX_VIDEO_RECORDING_DURATION + 1) * 1000} // an extra second for UI to load
tintColor={TAGG_PURPLE}
style={styles.bottomContainer}
lineCap={'round'}