From 568b9e047ff663b6fbab198d5a368dd8beb6a157 Mon Sep 17 00:00:00 2001 From: Ivan Date: Tue, 26 Mar 2024 23:42:25 +0800 Subject: [PATCH] updated sidebar.tsx fixed react DOM error --- web/src/components/Sidebar.tsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/web/src/components/Sidebar.tsx b/web/src/components/Sidebar.tsx index 86fb75b..e4ae764 100644 --- a/web/src/components/Sidebar.tsx +++ b/web/src/components/Sidebar.tsx @@ -103,10 +103,6 @@ const Sidebar: React.FC = ( if (isPlaying && agentPlacement && !audioPlaying && audioQueue.length > 0) { playAudio(audioQueue[0]); } - - if (!agentPlacement) { - setAudioQueue([]); - } }, [agentPlacement, isPlaying, audioQueue, audioPlaying]); useEffect(() => { @@ -128,6 +124,11 @@ const Sidebar: React.FC = ( } }); } + + if (!agentPlacement || !isPlayAudio) { + setAudioQueue([]); + } + }, [agentPlacement, showThoughts, isPlayAudio, stepId, substepId]); const handleRewind = (): void => {