@@ -39,9 +39,14 @@ export const VoiceMessageInput = ({
3939 const [ lastClickTime , setLastClickTime ] = useState < number > ( 0 ) ;
4040 const isReadyToRecord = useMemo ( ( ) => currentType === VoiceMessageInputStatus . READY_TO_RECORD , [ currentType ] ) ;
4141 const isRecording = useMemo ( ( ) => currentType === VoiceMessageInputStatus . RECORDING , [ currentType ] ) ;
42- const isSendButtonDisabled = useMemo ( ( ) => (
43- ( isRecording || isReadyToRecord ) && minRecordTime > currentValue
44- ) , [ isRecording , minRecordTime , currentValue ] ) ;
42+ const isSendButtonDisabled = useMemo ( ( ) => {
43+ if ( currentType === VoiceMessageInputStatus . READY_TO_RECORD
44+ || currentType === VoiceMessageInputStatus . RECORDING
45+ ) {
46+ return minRecordTime > currentValue
47+ }
48+ return false ;
49+ } , [ currentType , minRecordTime , currentValue ] ) ;
4550 const isPlayMode = useMemo ( ( ) => {
4651 return (
4752 currentType === VoiceMessageInputStatus . READY_TO_PLAY
@@ -59,7 +64,6 @@ export const VoiceMessageInput = ({
5964 } ;
6065 const handleOnControlClick = useCallback ( ( ) => {
6166 const currentTime = Date . now ( ) ;
62- console . log ( currentTime - lastClickTime , VOICE_RECORDER_CLICK_BUFFER_TIME )
6367 if ( currentTime - lastClickTime > VOICE_RECORDER_CLICK_BUFFER_TIME ) {
6468 onControlClick ( currentType ) ;
6569 setLastClickTime ( currentTime ) ;
0 commit comments