clear last tickets

This commit is contained in:
Thomas Demirdjian
2025-11-26 15:33:22 +01:00
parent ee9cc5dccd
commit d7b14bd873
25 changed files with 1692 additions and 1967 deletions
+19 -32
View File
@@ -29,37 +29,30 @@ export default ({
const SLIDER_WIDTH = layout?.width;
const MAX_VALUE = SLIDER_WIDTH - INITIAL_BOX_SIZE;
const handleSeekStart = () => {
if (seekEnabled && typeof onSeekStart === "function" && !seekingRef.current) {
seekingRef.current = true;
onSeekStart();
}
};
const handleSeekEnd = () => {
if (seekingRef.current && typeof onSeekEnd === "function") {
seekingRef.current = false;
onSeekEnd();
}
};
const pan = Gesture.Pan()
.enabled(seekEnabled)
.onBegin(() => {
if (
seekEnabled &&
typeof onSeekStart === "function" &&
!seekingRef.current
) {
seekingRef.current = true;
runOnJS(onSeekStart)();
}
runOnJS(handleSeekStart)();
})
.onStart(() => {
if (
seekEnabled &&
typeof onSeekStart === "function" &&
!seekingRef.current
) {
seekingRef.current = true;
runOnJS(onSeekStart)();
}
runOnJS(handleSeekStart)();
})
.onChange((event) => {
if (
seekEnabled &&
typeof onSeekStart === "function" &&
!seekingRef.current
) {
seekingRef.current = true;
runOnJS(onSeekStart)();
}
runOnJS(handleSeekStart)();
offset.value =
Math.abs(offset.value) <= MAX_VALUE
? offset.value + event.changeX <= 0
@@ -81,16 +74,10 @@ export default ({
// Reanimated -> JS thread bridge
runOnJS(onSeek)(ratio);
}
if (seekingRef.current && typeof onSeekEnd === "function") {
seekingRef.current = false;
runOnJS(onSeekEnd)();
}
runOnJS(handleSeekEnd)();
})
.onFinalize(() => {
if (seekingRef.current && typeof onSeekEnd === "function") {
seekingRef.current = false;
runOnJS(onSeekEnd)();
}
runOnJS(handleSeekEnd)();
});
// Reflect external progress into the slider UI