diff options
| author | Ivan Chen <ivan@tagg.id> | 2021-01-27 17:22:18 -0500 |
|---|---|---|
| committer | Ivan Chen <ivan@tagg.id> | 2021-01-27 17:22:18 -0500 |
| commit | 821f7b6e5b22405484c3545c6f17600d1f79feaa (patch) | |
| tree | 346f779dfaa8e4c4378b9d6f2dc1af4ec5aa9a54 /src/components/moments/MomentPostContent.tsx | |
| parent | e897fdbbbe8442f05000645395753ff008a19bf4 (diff) | |
| parent | 21a3e000443c5c4ab2ae91000108b9d3b0383964 (diff) | |
Merge branch 'master' into tma577-profile-slowness
# Conflicts:
# src/services/index.ts
Diffstat (limited to 'src/components/moments/MomentPostContent.tsx')
| -rw-r--r-- | src/components/moments/MomentPostContent.tsx | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/components/moments/MomentPostContent.tsx b/src/components/moments/MomentPostContent.tsx index 508b6d9f..d68ceaa3 100644 --- a/src/components/moments/MomentPostContent.tsx +++ b/src/components/moments/MomentPostContent.tsx @@ -1,6 +1,6 @@ import React, {useEffect} from 'react'; import {Image, StyleSheet, Text, View, ViewProps} from 'react-native'; -import {getMomentCommentsCount} from '../../services'; +import {getCommentsCount} from '../../services'; import {ScreenType} from '../../types'; import {getTimePosted, SCREEN_HEIGHT, SCREEN_WIDTH} from '../../utils'; import {CommentsCount} from '../comments'; @@ -24,8 +24,12 @@ const MomentPostContent: React.FC<MomentPostContentProps> = ({ const [comments_count, setCommentsCount] = React.useState(''); useEffect(() => { + const fetchCommentsCount = async () => { + const count = await getCommentsCount(momentId, false); + setCommentsCount(count); + }; setElapsedTime(getTimePosted(dateTime)); - getMomentCommentsCount(momentId, setCommentsCount); + fetchCommentsCount(); }, [dateTime, momentId]); return ( |
