Bluesky app fork with some witchin' additions 💫
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Don't toggle the date divider when tapping a reaction (#10274)

authored by

DS Boyce and committed by
GitHub
524cbc51 3358e194

+13 -1
+13 -1
src/components/dms/MessageItem.tsx
··· 1 - import {memo, useCallback, useEffect, useMemo} from 'react' 1 + import {memo, useCallback, useEffect, useMemo, useRef} from 'react' 2 2 import { 3 3 type GestureResponderEvent, 4 4 LayoutAnimation, ··· 106 106 const queryClient = useQueryClient() 107 107 108 108 const reactionsControl = useDialogControl() 109 + const reactionTapRef = useRef(false) 109 110 110 111 const {message, nextMessage, prevMessage} = item 111 112 const isPending = item.type === 'pending-message' ··· 328 329 transform: [{translateY: -8}], 329 330 }, 330 331 ]} 332 + onPressIn={() => { 333 + // Don't toggle the date divider when tapping a reaction. 334 + reactionTapRef.current = true 335 + }} 336 + onPressOut={() => { 337 + // Include a delay here to account for tap-and-drag before release. 338 + setTimeout(() => { 339 + reactionTapRef.current = false 340 + }, 100) 341 + }} 331 342 onPress={() => (isGroupChat ? reactionsControl.open() : undefined)}> 332 343 {groupedReactions.map(group => ( 333 344 <Animated.View ··· 427 438 isFromSelf={isFromSelf} 428 439 message={message} 429 440 onTap={() => { 441 + if (reactionTapRef.current) return 430 442 if (!hasLargeGapFromPrev) { 431 443 LayoutAnimation.configureNext( 432 444 LayoutAnimation.Presets.easeInEaseOut,