From 17af6485eb251c979430a7953acac34316f03cb4 Mon Sep 17 00:00:00 2001 From: Shravya Ramesh Date: Mon, 21 Jun 2021 13:51:42 -0700 Subject: Fix double click crash bug --- src/screens/profile/IndividualMoment.tsx | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/screens/profile/IndividualMoment.tsx b/src/screens/profile/IndividualMoment.tsx index 4088895a..2ad22db4 100644 --- a/src/screens/profile/IndividualMoment.tsx +++ b/src/screens/profile/IndividualMoment.tsx @@ -88,32 +88,27 @@ const IndividualMoment: React.FC = ({ data={momentData} renderItem={({item, index}) => ( )} keyExtractor={(item, _) => item.moment_id} showsVerticalScrollIndicator={false} initialScrollIndex={initialIndex} + onScrollToIndexFailed={(info) => { + setTimeout(() => { + scrollRef.current?.scrollToIndex({ + index: info.index, + }); + }, 500); + }} pagingEnabled /> ); }; -const styles = StyleSheet.create({ - contentContainer: { - paddingTop: StatusBarHeight, - flex: 1, - }, - header: { - height: normalize(70), - }, - listContentContainer: { - paddingBottom: SCREEN_HEIGHT * 0.2, - }, -}); export default IndividualMoment; -- cgit v1.2.3-70-g09d2