aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIvan Chen <ivan@tagg.id>2021-06-25 17:08:47 -0400
committerIvan Chen <ivan@tagg.id>2021-06-25 17:08:47 -0400
commita61996f4f1c6fa0556272ca3861b88e6d4272fbd (patch)
treecbb507c1996a8ea8e5a14d0f98f3143a48716323 /src
parentacc7081036177e036bd7f43c7975939d33e91f2c (diff)
Add logic to reset video progress
Diffstat (limited to 'src')
-rw-r--r--src/components/moments/MomentPost.tsx6
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