fix audio not working during development due to react's useEffect wil be triggered twice (#6126)

This commit is contained in:
Lance Mao 2024-07-23 17:24:29 +08:00 committed by GitHub
parent 6a9d202414
commit 75445a0c66
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -152,6 +152,10 @@ const VoiceInput = ({
useEffect(() => {
initCanvas()
handleStartRecord()
const recorderRef = recorder?.current
return () => {
recorderRef?.stop()
}
}, [])
const minutes = parseInt(`${parseInt(`${originDuration}`) / 60}`)