diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/components/comments/CommentTile.tsx | 8 | ||||
-rw-r--r-- | src/services/CommentService.ts | 4 |
2 files changed, 8 insertions, 4 deletions
diff --git a/src/components/comments/CommentTile.tsx b/src/components/comments/CommentTile.tsx index a31c5b51..d028ceea 100644 --- a/src/components/comments/CommentTile.tsx +++ b/src/components/comments/CommentTile.tsx @@ -1,4 +1,4 @@ -import {useNavigation} from '@react-navigation/native'; +import {CommonActions, useNavigation} from '@react-navigation/native'; import React, {Fragment, useContext, useEffect, useRef, useState} from 'react'; import {Alert, Animated, StyleSheet} from 'react-native'; import {Text, View} from 'react-native-animatable'; @@ -55,6 +55,7 @@ const CommentTile: React.FC<CommentTileProps> = ({ const [showReplies, setShowReplies] = useState<boolean>(false); const [showKeyboard, setShowKeyboard] = useState<boolean>(false); const [shouldUpdateChild, setShouldUpdateChild] = useState(true); + const [forceRerender, setForceRerender] = useState(0); const swipeRef = useRef<Swipeable>(null); const {replyPosted} = useSelector((state: RootState) => state.user); const state: RootState = useStore().getState(); @@ -151,7 +152,10 @@ const CommentTile: React.FC<CommentTileProps> = ({ /> <LikeButton filled={commentObject.user_reaction !== null} - onPress={() => handleLikeUnlikeComment(commentObject)} + onPress={() => { + handleLikeUnlikeComment(commentObject); + setShouldUpdateParent(true); + }} style={styles.likeButton} /> </View> diff --git a/src/services/CommentService.ts b/src/services/CommentService.ts index f5583ac0..e85b1991 100644 --- a/src/services/CommentService.ts +++ b/src/services/CommentService.ts @@ -181,11 +181,11 @@ export const getUsersReactedToAComment = async (comment: CommentBaseType) => { }); const typedResponse: { reaction: ReactionOptionsType; - users: ProfilePreviewType[]; + user_list: ProfilePreviewType[]; }[] = await response.json(); for (const obj of typedResponse) { if (obj.reaction === ReactionOptionsType.Like) { - return obj.users; + return obj.user_list; } } return []; |