Remove onEndGestureHandler

This commit is contained in:
Diego Mello 2023-10-26 14:49:06 -03:00
parent 92942bc07e
commit 5899dc890f
1 changed files with 1 additions and 13 deletions

View File

@ -40,7 +40,6 @@ const Seek = ({ currentTime, duration, loaded = false, onChangeTime }: ISeek) =>
const timePosition = useSharedValue(0);
const timeLabel = useSharedValue(DEFAULT_TIME_LABEL);
const scale = useSharedValue(1);
const onEndGestureHandler = useSharedValue(false);
const isTimeChanged = useSharedValue(false);
const styleLine = useAnimatedStyle(() => ({
@ -68,18 +67,7 @@ const Seek = ({ currentTime, duration, loaded = false, onChangeTime }: ISeek) =>
},
onEnd: () => {
scale.value = 1;
onEndGestureHandler.value = true;
}
});
const wrapper = async (time: number) => {
await onChangeTime(Math.round(time * 1000));
onEndGestureHandler.value = false;
};
useDerivedValue(() => {
if (onEndGestureHandler.value) {
runOnJS(wrapper)(currentTime.value);
runOnJS(onChangeTime)(Math.round(currentTime.value * 1000));
}
});