aboutsummaryrefslogtreecommitdiff
path: root/src/components
diff options
context:
space:
mode:
authorShravya Ramesh <shravs1208@gmail.com>2021-07-21 05:23:13 -0700
committerShravya Ramesh <shravs1208@gmail.com>2021-07-21 05:23:13 -0700
commit672a3df3c0e9761efd3701cb719970aa724f823d (patch)
tree2271a226dac7a9cbe94c1bda468701366edb4154 /src/components
parent4193ecccac86b9428d1f17fd7a3c5cd0ff92dd0a (diff)
Fix bump up view count issue
Diffstat (limited to 'src/components')
-rw-r--r--src/components/moments/MomentPost.tsx10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/components/moments/MomentPost.tsx b/src/components/moments/MomentPost.tsx
index 7b3ce6f8..6cb812e7 100644
--- a/src/components/moments/MomentPost.tsx
+++ b/src/components/moments/MomentPost.tsx
@@ -42,12 +42,14 @@ interface MomentPostProps {
moment: MomentPostType;
userXId: string | undefined;
screenType: ScreenType;
+ updateMomentViewCount: () => void;
}
const MomentPost: React.FC<MomentPostProps> = ({
moment,
userXId,
screenType,
+ updateMomentViewCount,
}) => {
const navigation = useNavigation();
const dispatch = useDispatch();
@@ -196,15 +198,15 @@ const MomentPost: React.FC<MomentPostProps> = ({
<View style={{paddingHorizontal: '3%'}}>
<Text style={styles.headerText}>{user.username}</Text>
<Text style={styles.viewCount}>
- {viewCount <= 9999
- ? `${viewCount} Views`
- : `${(viewCount / 1000).toFixed(1)}K Views`}
+ {moment.view_count <= 9999
+ ? `${moment.view_count} Views`
+ : `${(moment.view_count / 1000).toFixed(1)}K Views`}
</Text>
</View>
</TouchableOpacity>
</View>
),
- [user.username, viewCount],
+ [user.username, moment.view_count],
);
const momentMedia = isVideo ? (