diff options
author | Ivan Chen <ivan@tagg.id> | 2021-06-25 17:08:47 -0400 |
---|---|---|
committer | Ivan Chen <ivan@tagg.id> | 2021-06-25 17:08:47 -0400 |
commit | a61996f4f1c6fa0556272ca3861b88e6d4272fbd (patch) | |
tree | cbb507c1996a8ea8e5a14d0f98f3143a48716323 | |
parent | acc7081036177e036bd7f43c7975939d33e91f2c (diff) |
Add logic to reset video progress
-rw-r--r-- | src/components/moments/MomentPost.tsx | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/components/moments/MomentPost.tsx b/src/components/moments/MomentPost.tsx index 7d0752d5..70bea442 100644 --- a/src/components/moments/MomentPost.tsx +++ b/src/components/moments/MomentPost.tsx @@ -173,6 +173,12 @@ const MomentPost: React.FC<MomentPostProps> = ({ } }, [keyboardVisible, hideText]); + useEffect(() => { + if (moment.moment_id !== currentVisibleMomentId) { + videoRef.current?.seek(0); + } + }, [currentVisibleMomentId]); + const MomentPosterPreview = () => ( <View style={styles.momentPosterContainer}> <TouchableOpacity |