Skip to content

Commit db959de

Browse files
authored
fix: Reduce sending two messages from VoiceMessageInputWrapper (#455)
[UIKIT-3260](https://sendbird.atlassian.net/browse/UIKIT-3260) Issue: * Sending two voice messages when the playing status has been changed before sending voice message Fixes: * Remove the dependency `playingStatus` from onSubmitClick in the VoiceMessageInputWrapper component * Clean up the states after sending a voice message in the VoiceMessageInputWrapper component
1 parent b092569 commit db959de

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/smart-components/Channel/components/MessageInput/VoiceMessageInputWrapper.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,11 @@ export const VoiceMessageInputWrapper = ({
7676
useEffect(() => {
7777
if (isSubmited && audioFile) {
7878
onSubmitClick(audioFile, recordingTime);
79+
setSubmit(false);
80+
setAudioFile(null);
7981
}
82+
}, [isSubmited, audioFile, recordingTime]);
83+
useEffect(() => {
8084
if (audioFile) {
8185
if (recordingTime < minRecordingTime) {
8286
setVoiceInputState(VoiceMessageInputStatus.READY_TO_RECORD);

0 commit comments

Comments
 (0)