diff options
author | Ashm Walia <ashmwalia@outlook.com> | 2021-01-27 08:24:43 -0800 |
---|---|---|
committer | Ashm Walia <ashmwalia@outlook.com> | 2021-01-27 08:24:43 -0800 |
commit | 85c0f668665696ba8127ee1ea436d10ec0af955f (patch) | |
tree | 9b0cf515a04fabdb30f1583ec08b8d813a09c027 /src/components/moments/MomentPostContent.tsx | |
parent | 755f4f540d3e759ff9ad3bc35c64b6f7fc83998b (diff) |
Pre-final
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 ( |