Skip to content

Commit

Permalink
fix: Reduce sending two messages from VoiceMessageInputWrapper (#455)
Browse files Browse the repository at this point in the history
[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
  • Loading branch information
HoonBaek committed Mar 28, 2023
1 parent b092569 commit db959de
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,11 @@ export const VoiceMessageInputWrapper = ({
useEffect(() => {
if (isSubmited && audioFile) {
onSubmitClick(audioFile, recordingTime);
setSubmit(false);
setAudioFile(null);
}
}, [isSubmited, audioFile, recordingTime]);
useEffect(() => {
if (audioFile) {
if (recordingTime < minRecordingTime) {
setVoiceInputState(VoiceMessageInputStatus.READY_TO_RECORD);
Expand Down

0 comments on commit db959de

Please sign in to comment.