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 => {