aboutsummaryrefslogtreecommitdiff
path: root/src/components/comments/CommentTile.tsx
diff options
context:
space:
mode:
authorIvan Chen <ivan@tagg.id>2021-05-10 20:00:21 -0400
committerIvan Chen <ivan@tagg.id>2021-05-10 20:00:21 -0400
commit46cc8a33fe206c2c3bbd781374e727c1a42b9094 (patch)
treee0849a3c1155b3fd5cc3f24fbf6660d2a85dd413 /src/components/comments/CommentTile.tsx
parent0e9ec9b6403c1556fc53e895eb16ca477106e48e (diff)
fixed minor issues
Diffstat (limited to 'src/components/comments/CommentTile.tsx')
-rw-r--r--src/components/comments/CommentTile.tsx8
1 files changed, 6 insertions, 2 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>