mirror of
https://github.com/getpaseo/paseo.git
synced 2026-07-29 12:01:31 +00:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user