Fix thin red circle around Like button on iOS (#6123)

* remove animation UI from DOM tree when not animated

* improve naming of vars

* more var changes

---------

Co-authored-by: Hailey <me@haileyok.com>
This commit is contained in:
khuddite
2024-11-06 07:36:31 -05:00
committed by GitHub
parent 206df2ab80
commit f95acdc836
3 changed files with 14 additions and 17 deletions
+5 -4
View File
@@ -107,7 +107,8 @@ let PostCtrls = ({
[t],
) as StyleProp<ViewStyle>
const [isToggleLikeIcon, setIsToggleLikeIcon] = React.useState(false)
const [hasLikeIconBeenToggled, setHasLikeIconBeenToggled] =
React.useState(false)
const onPressToggleLike = React.useCallback(async () => {
if (isBlocked) {
@@ -119,7 +120,7 @@ let PostCtrls = ({
}
try {
setIsToggleLikeIcon(true)
setHasLikeIconBeenToggled(true)
if (!post.viewer?.like) {
playHaptic('Light')
sendInteraction({
@@ -311,13 +312,13 @@ let PostCtrls = ({
<AnimatedLikeIcon
isLiked={Boolean(post.viewer?.like)}
big={big}
isToggle={isToggleLikeIcon}
hasBeenToggled={hasLikeIconBeenToggled}
/>
<CountWheel
likeCount={post.likeCount ?? 0}
big={big}
isLiked={Boolean(post.viewer?.like)}
isToggle={isToggleLikeIcon}
hasBeenToggled={hasLikeIconBeenToggled}
/>
</Pressable>
</View>