diff options
author | Hailey <me@haileyok.com> | 2024-09-04 09:39:34 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-04 09:39:34 -0700 |
commit | 12b4a250d2fc546f8f8c698d3f67931d976e429f (patch) | |
tree | ada842e03af8fc597fc8fb6d81881eefba50a2bf /src/view/com/composer/Composer.tsx | |
parent | 45bb2477d8c89999e0b5f0c29ce496d060729805 (diff) | |
download | voidsky-12b4a250d2fc546f8f8c698d3f67931d976e429f.tar.zst |
[Video] `withRepeat` for spinner (#5141)
Diffstat (limited to 'src/view/com/composer/Composer.tsx')
-rw-r--r-- | src/view/com/composer/Composer.tsx | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/view/com/composer/Composer.tsx b/src/view/com/composer/Composer.tsx index 4a6e41411..d8aa598ef 100644 --- a/src/view/com/composer/Composer.tsx +++ b/src/view/com/composer/Composer.tsx @@ -27,6 +27,7 @@ import Animated, { useAnimatedStyle, useDerivedValue, useSharedValue, + withRepeat, withTiming, } from 'react-native-reanimated' import {useSafeAreaInsets} from 'react-native-safe-area-context' @@ -1089,10 +1090,13 @@ function VideoUploadToolbar({state}: {state: VideoUploadState}) { const rotate = useDerivedValue(() => { if (progress === 0 || progress >= 0.99) { - return withTiming(360, { - duration: 2500, - easing: Easing.out(Easing.cubic), - }) + return withRepeat( + withTiming(360, { + duration: 2500, + easing: Easing.out(Easing.cubic), + }), + -1, + ) } return 0 }) |