From f97671fa64a5ecb93cd03a5822ad207703bfa1c1 Mon Sep 17 00:00:00 2001 From: "junyoung.lim" Date: Fri, 14 Feb 2025 13:04:07 +0900 Subject: [PATCH 1/2] Fix VoiceMessageInput bug --- src/ui/VoiceMessageInput/index.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ui/VoiceMessageInput/index.tsx b/src/ui/VoiceMessageInput/index.tsx index 59d36cc63..285f2a2d4 100644 --- a/src/ui/VoiceMessageInput/index.tsx +++ b/src/ui/VoiceMessageInput/index.tsx @@ -1,4 +1,4 @@ -import React, { useCallback, useMemo, useState } from 'react'; +import React, { useMemo, useState } from 'react'; import './index.scss'; import PlaybackTime from '../PlaybackTime'; @@ -63,13 +63,13 @@ export const VoiceMessageInput = ({ setLastClickTime(currentTime); } }; - const handleOnControlClick = useCallback(() => { + const handleOnControlClick = () => { const currentTime = Date.now(); if (currentTime - lastClickTime > VOICE_RECORDER_CLICK_BUFFER_TIME) { onControlClick?.(currentType); setLastClickTime(currentTime); } - }, [currentType]); + }; const handleOnSubmitClick = () => { const currentTime = Date.now(); if (currentTime - lastClickTime > VOICE_RECORDER_CLICK_BUFFER_TIME) { From 7f5d4a9ba95853d24f47fbfe81179bcae30fd505 Mon Sep 17 00:00:00 2001 From: "junyoung.lim" Date: Fri, 14 Feb 2025 14:16:39 +0900 Subject: [PATCH 2/2] Add optional chaning for voiceRecord property --- src/hooks/VoiceRecorder/useVoiceRecorder.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hooks/VoiceRecorder/useVoiceRecorder.tsx b/src/hooks/VoiceRecorder/useVoiceRecorder.tsx index e317b1c2a..e6b885436 100644 --- a/src/hooks/VoiceRecorder/useVoiceRecorder.tsx +++ b/src/hooks/VoiceRecorder/useVoiceRecorder.tsx @@ -34,7 +34,7 @@ export const useVoiceRecorder = ({ const { state } = useSendbird(); const { config } = state; const { voiceRecord } = config; - const maxRecordingTime = voiceRecord.maxRecordingTime; + const maxRecordingTime = voiceRecord?.maxRecordingTime; const voiceRecorder = useVoiceRecorderContext(); const { isRecordable } = voiceRecorder;