fix audio not working during development due to react's useEffect wil be triggered twice (#6126)
This commit is contained in:
@@ -152,6 +152,10 @@ const VoiceInput = ({
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
initCanvas()
|
initCanvas()
|
||||||
handleStartRecord()
|
handleStartRecord()
|
||||||
|
const recorderRef = recorder?.current
|
||||||
|
return () => {
|
||||||
|
recorderRef?.stop()
|
||||||
|
}
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
const minutes = parseInt(`${parseInt(`${originDuration}`) / 60}`)
|
const minutes = parseInt(`${parseInt(`${originDuration}`) / 60}`)
|
||||||
|
Reference in New Issue
Block a user