Skip to content

Commit 6c31493

Browse files
authored
[SBISSUE-18534] onRecordingEnded Callback Not Triggered (#1311)
[SBISSUE-18534](https://sendbird.atlassian.net/browse/SBISSUE-18534) ### Changelog * Fixed the bug where `VoiceMessageIssue` doesn't work at the first time. [SBISSUE-18534]: https://sendbird.atlassian.net/browse/SBISSUE-18534?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
1 parent 67b5693 commit 6c31493

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/hooks/VoiceRecorder/useVoiceRecorder.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export const useVoiceRecorder = ({
3434
const { state } = useSendbird();
3535
const { config } = state;
3636
const { voiceRecord } = config;
37-
const maxRecordingTime = voiceRecord.maxRecordingTime;
37+
const maxRecordingTime = voiceRecord?.maxRecordingTime;
3838
const voiceRecorder = useVoiceRecorderContext();
3939
const { isRecordable } = voiceRecorder;
4040

src/ui/VoiceMessageInput/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { useCallback, useMemo, useState } from 'react';
1+
import React, { useMemo, useState } from 'react';
22
import './index.scss';
33

44
import PlaybackTime from '../PlaybackTime';
@@ -63,13 +63,13 @@ export const VoiceMessageInput = ({
6363
setLastClickTime(currentTime);
6464
}
6565
};
66-
const handleOnControlClick = useCallback(() => {
66+
const handleOnControlClick = () => {
6767
const currentTime = Date.now();
6868
if (currentTime - lastClickTime > VOICE_RECORDER_CLICK_BUFFER_TIME) {
6969
onControlClick?.(currentType);
7070
setLastClickTime(currentTime);
7171
}
72-
}, [currentType]);
72+
};
7373
const handleOnSubmitClick = () => {
7474
const currentTime = Date.now();
7575
if (currentTime - lastClickTime > VOICE_RECORDER_CLICK_BUFFER_TIME) {

0 commit comments

Comments
 (0)