Fix duplicate haptic feedback when liking posts (#10678)
This commit is contained in:
@@ -11,7 +11,6 @@ import {useLingui} from '@lingui/react/macro'
|
|||||||
|
|
||||||
import {CountWheel} from '#/lib/custom-animations/CountWheel'
|
import {CountWheel} from '#/lib/custom-animations/CountWheel'
|
||||||
import {AnimatedLikeIcon} from '#/lib/custom-animations/LikeIcon'
|
import {AnimatedLikeIcon} from '#/lib/custom-animations/LikeIcon'
|
||||||
import {useHaptics} from '#/lib/haptics'
|
|
||||||
import {useOpenComposer} from '#/lib/hooks/useOpenComposer'
|
import {useOpenComposer} from '#/lib/hooks/useOpenComposer'
|
||||||
import {type Shadow} from '#/state/cache/types'
|
import {type Shadow} from '#/state/cache/types'
|
||||||
import {useFeedFeedbackContext} from '#/state/feed-feedback'
|
import {useFeedFeedbackContext} from '#/state/feed-feedback'
|
||||||
@@ -93,7 +92,6 @@ let PostControls = ({
|
|||||||
const requireAuth = useRequireAuth()
|
const requireAuth = useRequireAuth()
|
||||||
const {sendInteraction} = useFeedFeedbackContext()
|
const {sendInteraction} = useFeedFeedbackContext()
|
||||||
const {captureAction} = useProgressGuideControls()
|
const {captureAction} = useProgressGuideControls()
|
||||||
const playHaptic = useHaptics()
|
|
||||||
const isBlocked = Boolean(
|
const isBlocked = Boolean(
|
||||||
post.author.viewer?.blocking ||
|
post.author.viewer?.blocking ||
|
||||||
post.author.viewer?.blockedBy ||
|
post.author.viewer?.blockedBy ||
|
||||||
@@ -116,7 +114,6 @@ let PostControls = ({
|
|||||||
try {
|
try {
|
||||||
setHasLikeIconBeenToggled(true)
|
setHasLikeIconBeenToggled(true)
|
||||||
if (!post.viewer?.like) {
|
if (!post.viewer?.like) {
|
||||||
playHaptic('Light')
|
|
||||||
sendInteraction({
|
sendInteraction({
|
||||||
item: post.uri,
|
item: post.uri,
|
||||||
event: 'app.bsky.feed.defs#interactionLike',
|
event: 'app.bsky.feed.defs#interactionLike',
|
||||||
|
|||||||
Reference in New Issue
Block a user