Skip to content

Commit 4032654

Browse files
committed
follow coderabbit 🙏:skin-tone-4:
1 parent 3d83714 commit 4032654

2 files changed

Lines changed: 4 additions & 33 deletions

File tree

app/app.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,12 @@
6868
[
6969
"./plugins/with-ws-fgs",
7070
{
71+
"microphone": true,
7172
"android": {
7273
"permissions": [
7374
"FOREGROUND_SERVICE",
7475
"FOREGROUND_SERVICE_DATA_SYNC",
76+
"FOREGROUND_SERVICE_MICROPHONE",
7577
"POST_NOTIFICATIONS"
7678
]
7779
}

app/app/components/PhoneAudioButton.tsx

Lines changed: 2 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import {
66
View,
77
StyleSheet,
88
ActivityIndicator,
9-
Animated,
109
} from 'react-native';
1110

1211
interface PhoneAudioButtonProps {
@@ -26,31 +25,6 @@ const PhoneAudioButton: React.FC<PhoneAudioButtonProps> = ({
2625
error,
2726
onPress,
2827
}) => {
29-
// Animated value for pulsing effect when recording
30-
const pulseAnim = React.useRef(new Animated.Value(1)).current;
31-
32-
React.useEffect(() => {
33-
if (isRecording) {
34-
// Create pulsing animation when recording
35-
Animated.loop(
36-
Animated.sequence([
37-
Animated.timing(pulseAnim, {
38-
toValue: 1.1,
39-
duration: 500,
40-
useNativeDriver: true,
41-
}),
42-
Animated.timing(pulseAnim, {
43-
toValue: 1,
44-
duration: 500,
45-
useNativeDriver: true,
46-
}),
47-
])
48-
).start();
49-
} else {
50-
// Stop animation when not recording
51-
pulseAnim.setValue(1);
52-
}
53-
}, [isRecording, pulseAnim]);
5428

5529
const getButtonStyle = () => {
5630
if (isDisabled && !isRecording) {
@@ -84,12 +58,7 @@ const PhoneAudioButton: React.FC<PhoneAudioButtonProps> = ({
8458

8559
return (
8660
<View style={styles.container}>
87-
<Animated.View
88-
style={[
89-
styles.buttonWrapper,
90-
isRecording && { transform: [{ scale: pulseAnim }] },
91-
]}
92-
>
61+
<View style={styles.buttonWrapper}>
9362
<TouchableOpacity
9463
style={getButtonStyle()}
9564
onPress={onPress}
@@ -105,7 +74,7 @@ const PhoneAudioButton: React.FC<PhoneAudioButtonProps> = ({
10574
</View>
10675
)}
10776
</TouchableOpacity>
108-
</Animated.View>
77+
</View>
10978

11079
{/* Audio Level Indicator */}
11180
{isRecording && (

0 commit comments

Comments
 (0)