Skip to content

Commit

Permalink
[Video] withRepeat for spinner (#5141)
Browse files Browse the repository at this point in the history
  • Loading branch information
haileyok authored Sep 4, 2024
1 parent 45bb247 commit 12b4a25
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/view/com/composer/Composer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import Animated, {
useAnimatedStyle,
useDerivedValue,
useSharedValue,
withRepeat,
withTiming,
} from 'react-native-reanimated'
import {useSafeAreaInsets} from 'react-native-safe-area-context'
Expand Down Expand Up @@ -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
})
Expand Down

0 comments on commit 12b4a25

Please sign in to comment.