Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
118 commits
Select commit Hold shift + click to select a range
f58a536
reanimated v4 and worklets
Rohit3523 Oct 12, 2025
23ec327
some alignment
Rohit3523 Oct 12, 2025
abab68f
remove unused
Rohit3523 Oct 12, 2025
1514c7e
runOnJs is now scheduleOnRN
Rohit3523 Oct 12, 2025
5f28192
jest update
Rohit3523 Oct 12, 2025
c0a4d25
chore: format code with Prettier [skip ci]
Rohit3523 Oct 12, 2025
f27e9f5
let me trigger ci
Rohit3523 Oct 12, 2025
14ecf41
revert
Rohit3523 Oct 12, 2025
58b5141
Using gorhom bottomsheet
Rohit3523 Oct 12, 2025
a624049
jest and test changes
Rohit3523 Oct 12, 2025
00af6b8
remove patch
Rohit3523 Oct 12, 2025
d181c65
fix type
Rohit3523 Oct 12, 2025
d3f516b
fix import, idk why they did this
Rohit3523 Oct 12, 2025
caedf9e
Merge remote-tracking branch 'upstream/develop' into reanimated-v4
Rohit3523 Jan 17, 2026
cbfe560
lint fix
Rohit3523 Jan 17, 2026
8f89ea2
chore: format code and fix lint issues [skip ci]
Rohit3523 Jan 17, 2026
65be6cf
feat: basic setup react-native-true-sheet
OtavioStasiak Feb 6, 2026
08056fb
fix: scroll height
OtavioStasiak Feb 6, 2026
b4a596f
fix: inconsistentaction sheet openning
OtavioStasiak Feb 6, 2026
76cc834
feat: add min height
OtavioStasiak Feb 6, 2026
e13c5a4
revert the bottom sheet changes
Rohit3523 Mar 6, 2026
4fe2c97
revert version
Rohit3523 Mar 6, 2026
64f4dd9
Merge branch 'develop' into reanimated-v4
Rohit3523 Mar 6, 2026
1dba726
lock fix
Rohit3523 Mar 6, 2026
caf9d5a
chore: format code and fix lint issues
Rohit3523 Mar 6, 2026
b0d5d9f
Merge branch 'develop' into test.poc-a11y-bottom-shet
OtavioStasiak Mar 6, 2026
e3ccc64
chore: use Touch instead of pressable
OtavioStasiak Mar 5, 2026
2f535e3
cleanup
OtavioStasiak Mar 6, 2026
3776737
fix: padding on list and custom actionSheet content
OtavioStasiak Mar 6, 2026
7f04181
fix: actionsheet + gesture handler compatibility
OtavioStasiak Mar 6, 2026
40d9fb9
rollback Pressable
OtavioStasiak Mar 6, 2026
f868d6d
fix: pressable emoji
OtavioStasiak Mar 6, 2026
504d378
chore: comment
OtavioStasiak Mar 6, 2026
54698cb
fix: action sheet custom content height
OtavioStasiak Mar 6, 2026
9ed2a82
fix: directory test
OtavioStasiak Mar 6, 2026
baca611
fix: emoji picker
OtavioStasiak Mar 6, 2026
fd97518
fix: close action sheet
OtavioStasiak Mar 9, 2026
deb038d
fix: bottom sheet emoji picker scroll and padding
OtavioStasiak Mar 9, 2026
6afa789
chore: format code and fix lint issues
OtavioStasiak Mar 9, 2026
3937eec
fix: bottomSheet iOS weird padding
OtavioStasiak Mar 9, 2026
acd8675
Merge branch 'develop' into test.poc-a11y-bottom-shet
OtavioStasiak Mar 9, 2026
854b508
fix: add sleep to pass tests
OtavioStasiak Mar 10, 2026
9feee82
fix: e2e tests
OtavioStasiak Mar 10, 2026
b5aaff9
Merge branch 'develop' into reanimated-v4
Rohit3523 Mar 10, 2026
6413650
conflict fix
Rohit3523 Mar 10, 2026
d0f3d39
Merge branch 'develop' into reanimated-v4
Rohit3523 Mar 10, 2026
a8cdebd
Move worklet plugin to last
Rohit3523 Mar 10, 2026
ebe4419
Merge branch 'reanimated-v4' of https://github.com/RocketChat/Rocket.…
Rohit3523 Mar 10, 2026
b054ed4
fix: roomView test
OtavioStasiak Mar 10, 2026
bcbc7fe
fix: e2e tests
OtavioStasiak Mar 10, 2026
8a0d12c
Merge branch 'develop' into test.poc-a11y-bottom-shet
OtavioStasiak Mar 10, 2026
02cd74f
fix: code improvements
OtavioStasiak Mar 11, 2026
e50f3ad
fix: update required height
OtavioStasiak Mar 11, 2026
af3098d
Update patches/@lodev09+react-native-true-sheet+3.7.3.patch
OtavioStasiak Mar 11, 2026
b7c2b2f
code improvements
OtavioStasiak Mar 11, 2026
22ff512
fix: style
OtavioStasiak Mar 11, 2026
cc271ef
chore: format code and fix lint issues
OtavioStasiak Mar 11, 2026
eb37e68
remove unused style
OtavioStasiak Mar 11, 2026
b5a87b7
clean patch package
OtavioStasiak Mar 12, 2026
a0a6854
fix: remove border rounded and fixing padding issues
OtavioStasiak Mar 12, 2026
ebd8f88
fix: list padding
OtavioStasiak Mar 12, 2026
f4defa6
adjust bottom padding
OtavioStasiak Mar 12, 2026
d66c812
fix: android Directory view Actionsheet click and Servers List render
OtavioStasiak Mar 12, 2026
7662c7f
fix: orientation and unit test
OtavioStasiak Mar 12, 2026
88e8b42
Merge branch 'develop' into test.poc-a11y-bottom-shet
OtavioStasiak Mar 12, 2026
c19cadf
chore: format code and fix lint issues
OtavioStasiak Mar 12, 2026
7946eb4
fix: remve highlight of handle
OtavioStasiak Mar 12, 2026
d6a3237
cleanup
OtavioStasiak Mar 13, 2026
6fc21de
more bottom sheet changes
Rohit3523 Mar 14, 2026
7d1f242
adjustment for android
Rohit3523 Mar 15, 2026
301b0c3
chore: format code and fix lint issues
Rohit3523 Mar 15, 2026
8daab95
rerun
Rohit3523 Mar 15, 2026
d23a7e0
revert
Rohit3523 Mar 15, 2026
7c02045
Merge branch 'test.poc-a11y-bottom-shet' of https://github.com/Rocket…
Rohit3523 Mar 15, 2026
38cd2c9
test update
Rohit3523 Mar 15, 2026
930c88a
some improvements
Rohit3523 Mar 16, 2026
d0d218b
fix test
Rohit3523 Mar 16, 2026
3bab462
test fix
Rohit3523 Mar 16, 2026
cd35041
Remove unused bottomSheet prop
Rohit3523 Mar 16, 2026
35b55df
memorise bottom sheet handle
Rohit3523 Mar 16, 2026
50e1ffc
remove unused import
Rohit3523 Mar 16, 2026
ec14b28
ios test fix
Rohit3523 Mar 16, 2026
28d9062
clear timeout
Rohit3523 Mar 16, 2026
fb40b8b
wait for animation to close
Rohit3523 Mar 16, 2026
ae5df9f
Merge branch 'develop' into test.poc-a11y-bottom-shet
Rohit3523 Mar 16, 2026
fdaf544
lint fix
Rohit3523 Mar 16, 2026
05c7b5a
chore: format code and fix lint issues
Rohit3523 Mar 16, 2026
5064359
add comment for extra style
Rohit3523 Mar 16, 2026
650104e
tap on point to hide sheet
Rohit3523 Mar 16, 2026
7144138
Merge branch 'test.poc-a11y-bottom-shet' of https://github.com/Rocket…
Rohit3523 Mar 16, 2026
8db5f90
suggested changes by copilot and copilot
Rohit3523 Mar 17, 2026
d3f23e7
chore: format code and fix lint issues
Rohit3523 Mar 17, 2026
c03938c
revert the test
Rohit3523 Mar 17, 2026
4e7cc2b
Merge branch 'test.poc-a11y-bottom-shet' of https://github.com/Rocket…
Rohit3523 Mar 17, 2026
0e45349
Change sheet min height
Rohit3523 Mar 17, 2026
dbffe97
disable content panning for android
Rohit3523 Mar 17, 2026
d33a796
chore: format code and fix lint issues
Rohit3523 Mar 17, 2026
719c192
rerun
Rohit3523 Mar 17, 2026
1e6da08
revert
Rohit3523 Mar 17, 2026
e8abcf1
test update
Rohit3523 Mar 17, 2026
8b410dc
correct cancel button height
Rohit3523 Mar 19, 2026
b81a3ae
Remove timeout to present sheet
Rohit3523 Mar 19, 2026
9c25b88
Added bottom sheet in dev because of storybook
Rohit3523 Mar 19, 2026
54c2e9d
Merge branch 'develop' into reanimated-v4
Rohit3523 Mar 19, 2026
2b3e51a
lock file fixed
Rohit3523 Mar 19, 2026
5756896
Merge branch 'develop' into test.poc-a11y-bottom-shet
Rohit3523 Mar 19, 2026
45d1292
increase reaction open time
Rohit3523 Mar 20, 2026
ac20a76
Merge branch 'test.poc-a11y-bottom-shet' of https://github.com/Rocket…
Rohit3523 Mar 20, 2026
cdda960
increase timeout
Rohit3523 Mar 20, 2026
cff02b6
Removed deprecated addWhitelistedNativeProps
Rohit3523 Mar 21, 2026
c48a040
Merge branch 'test.poc-a11y-bottom-shet' into reanimated-v4
Rohit3523 Mar 23, 2026
cdf85b0
Merge branch 'develop' into reanimated-v4
Rohit3523 Mar 24, 2026
4ff6637
pod update
Rohit3523 Mar 24, 2026
88be3cd
coderabbit suggestion
Rohit3523 Mar 25, 2026
6bb597e
Merge branch 'develop' into reanimated-v4
Rohit3523 Mar 25, 2026
03e0ae0
seekbar improvement
Rohit3523 Mar 25, 2026
a130cd1
Replace more runOnJS to scheduleOnRN
Rohit3523 Mar 25, 2026
a541660
Merge branch 'reanimated-v4' of https://github.com/RocketChat/Rocket.…
Rohit3523 Mar 25, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 24 additions & 20 deletions app/containers/AudioPlayer/Seek.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
import React from 'react';
import { type LayoutChangeEvent, View, TextInput, type TextInputProps, TouchableNativeFeedback } from 'react-native';
import { PanGestureHandler, type PanGestureHandlerGestureEvent } from 'react-native-gesture-handler';
import { Gesture, GestureDetector } from 'react-native-gesture-handler';
import Animated, {
type SharedValue,
runOnJS,
useAnimatedGestureHandler,
useAnimatedProps,
useAnimatedStyle,
useDerivedValue,
useSharedValue
useSharedValue,
withTiming
} from 'react-native-reanimated';
import { scheduleOnRN } from 'react-native-worklets';

import styles from './styles';
import { useTheme } from '../../theme';
import { SEEK_HIT_SLOP, THUMB_SEEK_SIZE, ACTIVE_OFFSET_X, DEFAULT_TIME_LABEL } from './constants';

Animated.addWhitelistedNativeProps({ text: true });
const AnimatedTextInput = Animated.createAnimatedComponent(TextInput);

interface ISeek {
Expand Down Expand Up @@ -50,6 +49,7 @@ const Seek = ({ currentTime, duration, loaded = false, onChangeTime }: ISeek) =>
const timeLabel = useSharedValue(DEFAULT_TIME_LABEL);
const scale = useSharedValue(1);
const isPanning = useSharedValue(false);
const contextX = useSharedValue(0);

const styleLine = useAnimatedStyle(() => ({
width: translateX.value
Expand All @@ -64,21 +64,25 @@ const Seek = ({ currentTime, duration, loaded = false, onChangeTime }: ISeek) =>
maxWidth.value = width;
};

const onGestureEvent = useAnimatedGestureHandler<PanGestureHandlerGestureEvent, { offsetX: number }>({
onStart: (_event, ctx) => {
const panGesture = Gesture.Pan()
.enabled(loaded)
.activeOffsetX([-ACTIVE_OFFSET_X, ACTIVE_OFFSET_X])
.onStart(() => {
isPanning.value = true;
ctx.offsetX = translateX.value;
},
onActive: ({ translationX }, ctx) => {
translateX.value = clamp(ctx.offsetX + translationX, 0, maxWidth.value);
scale.value = 1.3;
},
onFinish() {
scale.value = 1;
contextX.value = translateX.value;
scale.value = withTiming(1.3, { duration: 150 });
})
.onUpdate(event => {
const newX = contextX.value + event.translationX;
translateX.value = clamp(newX, 0, maxWidth.value);
})
.onEnd(() => {
scheduleOnRN(onChangeTime, Math.round(currentTime.value * 1000));
})
Comment on lines +67 to +81
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

cd app/containers/AudioPlayer && wc -l Seek.tsx

Repository: RocketChat/Rocket.Chat.ReactNative

Length of output: 90


🏁 Script executed:

cat -n app/containers/AudioPlayer/Seek.tsx | head -100

Repository: RocketChat/Rocket.Chat.ReactNative

Length of output: 4014


🏁 Script executed:

# Search for ISeek interface definition
rg "interface ISeek" -A 10

Repository: RocketChat/Rocket.Chat.ReactNative

Length of output: 743


🏁 Script executed:

# Search for scheduleOnRN usage and imports
rg "scheduleOnRN" -B 2 -A 2

Repository: RocketChat/Rocket.Chat.ReactNative

Length of output: 8010


🏁 Script executed:

# Search for onChangeTime type definition
rg "onChangeTime" -B 2 -A 2

Repository: RocketChat/Rocket.Chat.ReactNative

Length of output: 1552


Wrap the async seek callback before scheduling it.

Line 80 passes onChangeTime directly to scheduleOnRN. Since onChangeTime returns Promise<void> but scheduleOnRN is fire-and-forget (void return), any rejection from the seek operation will result in an unhandled promise rejection that bypasses error handling. Define an RN-scope wrapper in the component body that catches and routes promise rejections through the existing error path, then schedule that wrapper instead. (docs.swmansion.com)

🛡️ Proposed fix
+ const commitChangeTime = React.useCallback((time: number) => {
+ 	void onChangeTime(time).catch(() => {
+ 		// Route this through the existing error/reporting path.
+ 	});
+ }, [onChangeTime]);
+
  const panGesture = Gesture.Pan()
  	.enabled(loaded)
  	.activeOffsetX([-ACTIVE_OFFSET_X, ACTIVE_OFFSET_X])
  	.onStart(() => {
  		isPanning.value = true;
  		contextX.value = translateX.value;
  		scale.value = withTiming(1.3, { duration: 150 });
  	})
  	.onUpdate(event => {
  		const newX = contextX.value + event.translationX;
  		translateX.value = clamp(newX, 0, maxWidth.value);
  	})
  	.onEnd(() => {
- 		scheduleOnRN(onChangeTime, Math.round(currentTime.value * 1000));
+ 		scheduleOnRN(commitChangeTime, Math.round(currentTime.value * 1000));
  	})
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@app/containers/AudioPlayer/Seek.tsx` around lines 67 - 81, The onEnd handler
schedules onChangeTime (an async Promise-returning function) directly via
scheduleOnRN which can cause unhandled rejections; create a RN-scoped wrapper in
the component (e.g., seekOnRN) that calls
onChangeTime(Math.round(currentTime.value * 1000)), catches any rejection and
forwards it to the component's existing error path/handler, and then pass that
wrapper to scheduleOnRN in panGesture.onEnd instead of onChangeTime.

.onFinalize(() => {
isPanning.value = false;
runOnJS(onChangeTime)(Math.round(currentTime.value * 1000));
}
});
scale.value = withTiming(1, { duration: 150 });
});
Comment on lines +82 to +85
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

find . -name "Seek.tsx" -type f

Repository: RocketChat/Rocket.Chat.ReactNative

Length of output: 115


🏁 Script executed:

cat -n ./app/containers/AudioPlayer/Seek.tsx

Repository: RocketChat/Rocket.Chat.ReactNative

Length of output: 5414


🌐 Web query:

react-native-gesture-handler pan gesture onFinalize didSucceed parameter

💡 Result:

In react-native-gesture-handler, the Pan gesture's onFinalize callback receives a second parameter called didSucceed, which is a boolean indicating whether the gesture was successfully recognized and completed. Signature: onFinalize: (event: PanHandlerData, didSucceed: boolean) => void - didSucceed is true if the gesture reached the END state (successfully completed after being ACTIVE). - didSucceed is false if the gesture FAILED or was CANCELLED. This applies to the modern API (usePanGesture in RNGH 3.x+). The callback is called whenever the handler stops recognizing the gesture, after onDeactivate if the gesture activated.

Citations:


Restore the pre-pan position when the gesture is cancelled.

When a pan gesture is cancelled, onEnd does not run (it only executes for successful gestures), so onChangeTime is never called and the seek is not committed. However, onFinalize always runs and provides didSucceed to indicate the outcome. Since currentTime.value is mutated during panning (line 91), a cancelled gesture leaves the thumb at an uncommitted position until the next external update. Restore the pre-pan translateX and currentTime from the captured contextX value when didSucceed === false:

🔁 Proposed fix
- 		.onFinalize(() => {
+ 		.onFinalize((_, didSucceed) => {
+ 			if (isPanning.value && !didSucceed) {
+ 				translateX.value = contextX.value;
+ 				currentTime.value = (contextX.value * duration.value) / maxWidth.value || 0;
+ 			}
  			isPanning.value = false;
  			scale.value = withTiming(1, { duration: 150 });
  		});
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@app/containers/AudioPlayer/Seek.tsx` around lines 82 - 85, onFinalize
currently always resets isPanning and scale but doesn’t restore state when a pan
is cancelled; update the onFinalize callback to check the provided didSucceed
flag and if didSucceed === false restore the pre-pan position by setting
translateX back to the captured contextX and resetting currentTime.value from
contextX (the same context captured during gesture start), otherwise (didSucceed
=== true) call onChangeTime to commit the seek; ensure you still set
isPanning.value = false and run scale.value = withTiming(1, { duration: 150 })
in all cases.


useDerivedValue(() => {
if (isPanning.value) {
Expand Down Expand Up @@ -118,9 +122,9 @@ const Seek = ({ currentTime, duration, loaded = false, onChangeTime }: ISeek) =>
<View style={[styles.line, { backgroundColor: colors.strokeLight }]}>
<Animated.View style={[styles.line, styleLine, { backgroundColor: colors.buttonBackgroundPrimaryDefault }]} />
</View>
<PanGestureHandler enabled={loaded} onGestureEvent={onGestureEvent} activeOffsetX={[-ACTIVE_OFFSET_X, ACTIVE_OFFSET_X]}>
<GestureDetector gesture={panGesture}>
<Animated.View hitSlop={SEEK_HIT_SLOP} style={[styles.thumbSeek, { backgroundColor: thumbColor }, styleThumb]} />
</PanGestureHandler>
</GestureDetector>
</View>
</View>
</TouchableNativeFeedback>
Expand Down
7 changes: 4 additions & 3 deletions app/containers/MessageComposer/hooks/useEmojiKeyboard.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import React, { createContext, type ReactElement, useContext, useState } from 'react';
import { Platform } from 'react-native';
import { useKeyboardHandler } from 'react-native-keyboard-controller';
import { runOnJS, type SharedValue, useAnimatedReaction, useSharedValue } from 'react-native-reanimated';
import { type SharedValue, useAnimatedReaction, useSharedValue } from 'react-native-reanimated';
import { useSafeAreaInsets } from 'react-native-safe-area-context';
import { scheduleOnRN } from 'react-native-worklets';

import { MessageInnerContext } from '../context';

Expand Down Expand Up @@ -155,7 +156,7 @@ export const useEmojiKeyboard = () => {
} else if (previousHeight.value === EMOJI_KEYBOARD_FIXED_HEIGHT) {
updateHeight();
}
runOnJS(setShowEmojiKeyboard)(currentValue);
scheduleOnRN(setShowEmojiKeyboard, currentValue);
},
[showEmojiPickerSharedValue]
);
Expand All @@ -171,7 +172,7 @@ export const useEmojiKeyboard = () => {
} else if (currentValue === false && showEmojiPickerSharedValue.value === true) {
openEmojiPicker();
}
runOnJS(setShowEmojiSearchbar)(currentValue);
scheduleOnRN(setShowEmojiSearchbar, currentValue);
},
[showEmojiSearchbarSharedValue]
);
Expand Down
10 changes: 5 additions & 5 deletions app/containers/RoomItem/Actions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import Animated, {
useAnimatedStyle,
interpolate,
withSpring,
runOnJS,
useAnimatedReaction,
useSharedValue
} from 'react-native-reanimated';
import { RectButton } from 'react-native-gesture-handler';
import * as Haptics from 'expo-haptics';
import { scheduleOnRN } from 'react-native-worklets';

import { CustomIcon } from '../CustomIcon';
import { DisplayMode } from '../../lib/constants/constantDisplayMode';
Expand Down Expand Up @@ -81,14 +81,14 @@ export const RightActions = React.memo(({ transX, favorite, width, toggleFav, on
// Triggers the animation and hapticFeedback if swipe reaches/unreaches the threshold.
if (I18n.isRTL) {
if (previousTransX && currentTransX > LONG_SWIPE && previousTransX <= LONG_SWIPE) {
runOnJS(triggerHideAnimation)(ACTION_WIDTH);
scheduleOnRN(triggerHideAnimation, ACTION_WIDTH);
} else if (previousTransX && currentTransX <= LONG_SWIPE && previousTransX > LONG_SWIPE) {
runOnJS(triggerHideAnimation)(0);
scheduleOnRN(triggerHideAnimation, 0);
}
} else if (previousTransX && currentTransX < -LONG_SWIPE && previousTransX >= -LONG_SWIPE) {
runOnJS(triggerHideAnimation)(-ACTION_WIDTH);
scheduleOnRN(triggerHideAnimation, -ACTION_WIDTH);
} else if (previousTransX && currentTransX >= -LONG_SWIPE && previousTransX < -LONG_SWIPE) {
runOnJS(triggerHideAnimation)(0);
scheduleOnRN(triggerHideAnimation, 0);
}
}
);
Expand Down
7 changes: 4 additions & 3 deletions app/containers/RoomItem/Touchable.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import React, { useRef, memo } from 'react';
import Animated, { useSharedValue, useAnimatedStyle, withSpring, runOnJS } from 'react-native-reanimated';
import Animated, { useSharedValue, useAnimatedStyle, withSpring } from 'react-native-reanimated';
import {
Gesture,
GestureDetector,
type GestureUpdateEvent,
type PanGestureHandlerEventPayload
} from 'react-native-gesture-handler';
import { scheduleOnRN } from 'react-native-worklets';

import Touch from '../Touch';
import { ACTION_WIDTH, LONG_SWIPE, SMALL_SWIPE } from './styles';
Expand Down Expand Up @@ -172,7 +173,7 @@ const Touchable = ({
const longPressGesture = Gesture.LongPress()
.minDuration(500)
.onStart(() => {
runOnJS(handleLongPress)();
scheduleOnRN(handleLongPress);
});

const panGesture = Gesture.Pan()
Expand All @@ -184,7 +185,7 @@ const Touchable = ({
if (transX.value > 2 * width) transX.value = 2 * width;
})
.onEnd(event => {
runOnJS(handleRelease)(event);
scheduleOnRN(handleRelease, event);
});

// Use Race instead of Simultaneous to prevent conflicts
Expand Down
6 changes: 3 additions & 3 deletions app/containers/RoomItem/interfaces.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type React from 'react';
import type Animated from 'react-native-reanimated';
import { type SharedValue } from 'react-native-reanimated';

import { type TSupportedThemes } from '../../theme';
import {
Expand All @@ -11,15 +11,15 @@ import {
} from '../../definitions';

export interface ILeftActionsProps {
transX: Animated.SharedValue<number>;
transX: SharedValue<number>;
isRead: boolean;
width: number;
onToggleReadPress(): void;
displayMode: string;
}

export interface IRightActionsProps {
transX: Animated.SharedValue<number>;
transX: SharedValue<number>;
favorite: boolean;
width: number;
toggleFav(): void;
Expand Down
10 changes: 5 additions & 5 deletions app/containers/ServerItem/SwipeableDeleteItem/Actions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import Animated, {
useAnimatedStyle,
interpolate,
withSpring,
runOnJS,
useAnimatedReaction,
useSharedValue,
type SharedValue
} from 'react-native-reanimated';
import { RectButton } from 'react-native-gesture-handler';
import * as Haptics from 'expo-haptics';
import { scheduleOnRN } from 'react-native-worklets';

import { CustomIcon } from '../../CustomIcon';
import { useTheme } from '../../../theme';
Expand Down Expand Up @@ -44,14 +44,14 @@ export const DeleteAction = React.memo(
(currentTransX, previousTransX) => {
if (I18n.isRTL) {
if (previousTransX && currentTransX > longSwipe && previousTransX <= longSwipe) {
runOnJS(triggerDeleteAnimation)(actionWidth);
scheduleOnRN(triggerDeleteAnimation, actionWidth);
} else if (previousTransX && currentTransX <= longSwipe && previousTransX > longSwipe) {
runOnJS(triggerDeleteAnimation)(0);
scheduleOnRN(triggerDeleteAnimation, 0);
}
} else if (previousTransX && currentTransX < -longSwipe && previousTransX >= -longSwipe) {
runOnJS(triggerDeleteAnimation)(-actionWidth);
scheduleOnRN(triggerDeleteAnimation, -actionWidth);
} else if (previousTransX && currentTransX >= -longSwipe && previousTransX < -longSwipe) {
runOnJS(triggerDeleteAnimation)(0);
scheduleOnRN(triggerDeleteAnimation, 0);
}
}
);
Expand Down
5 changes: 3 additions & 2 deletions app/containers/ServerItem/SwipeableDeleteItem/Touchable.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import React, { useRef, memo } from 'react';
import Animated, { useSharedValue, useAnimatedStyle, withSpring, runOnJS } from 'react-native-reanimated';
import Animated, { useSharedValue, useAnimatedStyle, withSpring } from 'react-native-reanimated';
import {
Gesture,
GestureDetector,
type GestureUpdateEvent,
type PanGestureHandlerEventPayload
} from 'react-native-gesture-handler';
import { View, type AccessibilityActionEvent } from 'react-native';
import { scheduleOnRN } from 'react-native-worklets';

import Touch from '../../Touch';
import { DeleteAction } from './Actions';
Expand Down Expand Up @@ -174,7 +175,7 @@ const SwipeableDeleteTouchable = ({
}
})
.onEnd(event => {
runOnJS(handleRelease)(event);
scheduleOnRN(handleRelease, event);
});

const animatedStyles = useAnimatedStyle(() => ({
Expand Down
Loading
Loading