Page MenuHomePhabricator

D9053.id30790.diff
No OneTemporary

D9053.id30790.diff

diff --git a/native/chat/swipeable-message.react.js b/native/chat/swipeable-message.react.js
--- a/native/chat/swipeable-message.react.js
+++ b/native/chat/swipeable-message.react.js
@@ -26,6 +26,9 @@
const primaryThreshold = 40;
const secondaryThreshold = 120;
+const panGestureHandlerActiveOffsetX = [-4, 4];
+const panGestureHandlerFailOffsetY = [-5, 5];
+
function dividePastDistance(value, distance, factor) {
'worklet';
const absValue = Math.abs(value);
@@ -239,6 +242,11 @@
const { contentStyle, children } = props;
+ const panGestureHandlerStyle = React.useMemo(
+ () => [contentStyle, transformContentStyle],
+ [contentStyle, transformContentStyle],
+ );
+
if (!triggerReply && !triggerSidebar) {
return (
<PanGestureHandler enabled={false}>
@@ -305,15 +313,13 @@
snakes.push(
<PanGestureHandler
maxPointers={1}
- activeOffsetX={[-4, 4]}
+ activeOffsetX={panGestureHandlerActiveOffsetX}
onGestureEvent={swipeEvent}
failOffsetX={isViewer ? 5 : -5}
- failOffsetY={[-5, 5]}
+ failOffsetY={panGestureHandlerFailOffsetY}
key="gesture"
>
- <Animated.View style={[contentStyle, transformContentStyle]}>
- {children}
- </Animated.View>
+ <Animated.View style={panGestureHandlerStyle}>{children}</Animated.View>
</PanGestureHandler>,
);

File Metadata

Mime Type
text/plain
Expires
Wed, Jan 8, 8:25 PM (1 h, 7 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2822715
Default Alt Text
D9053.id30790.diff (1 KB)

Event Timeline