Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

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

Lance Mao75445a0c66e2
diff --git a/web/app/components/base/voice-input/index.tsx b/web/app/components/base/voice-input/index.tsx
index b42e3b849e4..07b3c5ddcf1 100644
--- a/web/app/components/base/voice-input/index.tsx
+++ b/web/app/components/base/voice-input/index.tsx
@@ -152,6 +152,10 @@ const VoiceInput = ({
useEffect(() => {
initCanvas()
handleStartRecord()
+ const recorderRef = recorder?.current
+ return () => {
+ recorderRef?.stop()
+ }
}, [])
const minutes = parseInt(`${parseInt(`${originDuration}`) / 60}`)