mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-14 05:55:52 +08:00
fix audio not working during development due to react's useEffect wil be triggered twice (#6126)
This commit is contained in:
parent
6a9d202414
commit
75445a0c66
@ -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}`)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user