diff options
Diffstat (limited to 'src/components')
| -rw-r--r-- | src/components/moments/MomentUploadProgressBar.tsx | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/components/moments/MomentUploadProgressBar.tsx b/src/components/moments/MomentUploadProgressBar.tsx index 28fbd8cb..0d84236d 100644 --- a/src/components/moments/MomentUploadProgressBar.tsx +++ b/src/components/moments/MomentUploadProgressBar.tsx @@ -4,6 +4,7 @@ import {View} from 'react-native-animatable'; import {Easing, useSharedValue, withTiming} from 'react-native-reanimated'; import {SafeAreaView} from 'react-native-safe-area-context'; import {useSelector} from 'react-redux'; +import {checkMomentUploadFinished} from '../../services'; import {RootState} from '../../store/rootReducer'; import {MomentUploadStatusType} from '../../types'; import {normalize, SCREEN_WIDTH, StatusBarHeight} from '../../utils'; @@ -22,6 +23,21 @@ const MomentUploadProgressBar: React.FC<MomentUploadProgressBarProps> = if ( momentUploadProgressBar?.status === MomentUploadStatusType.Uploading ) { + const timer = setInterval(async () => { + if (checkMomentUploadFinished(momentUploadProgressBar.momentId)) { + // call upload finished action + } + }, 5 * 1000); + setTimeout(() => { + clearInterval(timer); + }, 5 * 60 * 1000); + } + }, []); + + useEffect(() => { + if ( + momentUploadProgressBar?.status === MomentUploadStatusType.Uploading + ) { progress.value = withTiming(1, { duration: momentUploadProgressBar.originalVideoDuration * 1000, easing: Easing.out(Easing.quad), |
