fix(app): add worklet directives to working indicator functions

Functions called inside useAnimatedStyle must be marked as worklets.
Missing directives caused a native crash on Android with newer
react-native-reanimated/worklets that enforce UI-thread safety.
This commit is contained in:
Mohamed Boudra
2026-03-20 12:19:22 +07:00
parent 26c07b671f
commit 70fb5f5bfd

View File

@@ -6,6 +6,7 @@ export const WORKING_INDICATOR_OFFSETS = [
] as const;
function normalizePhase(value: number): number {
"worklet";
const wrapped = value % 1;
return wrapped < 0 ? wrapped + 1 : wrapped;
}
@@ -14,6 +15,7 @@ export function getWorkingIndicatorDotStrength(
progress: number,
offset: number
): number {
"worklet";
const phase = normalizePhase(progress + offset);
if (phase <= 0.5) {
return phase * 2;