File tree Expand file tree Collapse file tree 3 files changed +9
-12
lines changed
Expand file tree Collapse file tree 3 files changed +9
-12
lines changed Original file line number Diff line number Diff line change @@ -85,7 +85,6 @@ import {
8585} from '../../icons' ;
8686import {
8787 FlatList as FlatListDefault ,
88- isAudioRecorderAvailable ,
8988 isDocumentPickerAvailable ,
9089 isImageMediaLibraryAvailable ,
9190 isImagePickerAvailable ,
@@ -494,7 +493,7 @@ const ChannelWithContext = <
494493 AudioAttachment = AudioAttachmentDefault ,
495494 AudioAttachmentUploadPreview = AudioAttachmentDefault ,
496495 AudioRecorder = AudioRecorderDefault ,
497- audioRecordingEnabled = isAudioRecorderAvailable ( ) ,
496+ audioRecordingEnabled = false ,
498497 AudioRecordingInProgress = AudioRecordingInProgressDefault ,
499498 AudioRecordingLockIndicator = AudioRecordingLockIndicatorDefault ,
500499 AudioRecordingPreview = AudioRecordingPreviewDefault ,
Original file line number Diff line number Diff line change @@ -56,7 +56,11 @@ import {
5656 useTranslationContext ,
5757} from '../../contexts/translationContext/TranslationContext' ;
5858
59- import { isImageMediaLibraryAvailable , triggerHaptic } from '../../native' ;
59+ import {
60+ isAudioRecorderAvailable ,
61+ isImageMediaLibraryAvailable ,
62+ triggerHaptic ,
63+ } from '../../native' ;
6064import type { Asset , DefaultStreamChatGenerics } from '../../types/types' ;
6165import { AIStates , useAIState } from '../AITypingIndicatorView' ;
6266import { AutoCompleteInput } from '../AutoCompleteInput/AutoCompleteInput' ;
@@ -624,7 +628,7 @@ const MessageInputWithContext = <
624628 } = useAudioController ( ) ;
625629
626630 const isSendingButtonVisible = ( ) => {
627- if ( audioRecordingEnabled ) {
631+ if ( audioRecordingEnabled && isAudioRecorderAvailable ( ) ) {
628632 if ( recording ) {
629633 return false ;
630634 }
@@ -856,7 +860,7 @@ const MessageInputWithContext = <
856860 </ View >
857861 ) )
858862 ) }
859- { audioRecordingEnabled && ! micLocked && (
863+ { audioRecordingEnabled && isAudioRecorderAvailable ( ) && ! micLocked && (
860864 < GestureDetector gesture = { panGestureMic } >
861865 < Animated . View
862866 style = { [
Original file line number Diff line number Diff line change @@ -8,11 +8,7 @@ import {
88import { useTheme } from '../../../../contexts/themeContext/ThemeContext' ;
99import { useTranslationContext } from '../../../../contexts/translationContext/TranslationContext' ;
1010import { Mic } from '../../../../icons/Mic' ;
11- import {
12- AudioRecordingReturnType ,
13- isAudioRecorderAvailable ,
14- triggerHaptic ,
15- } from '../../../../native' ;
11+ import { AudioRecordingReturnType , triggerHaptic } from '../../../../native' ;
1612
1713import type { DefaultStreamChatGenerics } from '../../../../types/types' ;
1814
@@ -102,8 +98,6 @@ const AudioRecordingButtonWithContext = <
10298 }
10399 } ;
104100
105- if ( ! isAudioRecorderAvailable ( ) ) return null ;
106-
107101 return (
108102 < Pressable
109103 delayLongPress = { asyncMessagesMinimumPressDuration }
You can’t perform that action at this time.
0 commit comments