Skip to content

Commit 12b4a25

Browse files
authored
[Video] withRepeat for spinner (#5141)
1 parent 45bb247 commit 12b4a25

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/view/com/composer/Composer.tsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import Animated, {
2727
useAnimatedStyle,
2828
useDerivedValue,
2929
useSharedValue,
30+
withRepeat,
3031
withTiming,
3132
} from 'react-native-reanimated'
3233
import {useSafeAreaInsets} from 'react-native-safe-area-context'
@@ -1089,10 +1090,13 @@ function VideoUploadToolbar({state}: {state: VideoUploadState}) {
10891090

10901091
const rotate = useDerivedValue(() => {
10911092
if (progress === 0 || progress >= 0.99) {
1092-
return withTiming(360, {
1093-
duration: 2500,
1094-
easing: Easing.out(Easing.cubic),
1095-
})
1093+
return withRepeat(
1094+
withTiming(360, {
1095+
duration: 2500,
1096+
easing: Easing.out(Easing.cubic),
1097+
}),
1098+
-1,
1099+
)
10961100
}
10971101
return 0
10981102
})

0 commit comments

Comments
 (0)