Skip to content

Commit

Permalink
updated sidebar.tsx
Browse files Browse the repository at this point in the history
fixed react DOM error
  • Loading branch information
chiefeu committed Mar 26, 2024
1 parent b942122 commit 568b9e0
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions web/src/components/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,6 @@ const Sidebar: React.FC<SidebarProps> = (
if (isPlaying && agentPlacement && !audioPlaying && audioQueue.length > 0) {
playAudio(audioQueue[0]);
}

if (!agentPlacement) {
setAudioQueue([]);
}
}, [agentPlacement, isPlaying, audioQueue, audioPlaying]);

useEffect(() => {
Expand All @@ -128,6 +124,11 @@ const Sidebar: React.FC<SidebarProps> = (
}
});
}

if (!agentPlacement || !isPlayAudio) {
setAudioQueue([]);
}

}, [agentPlacement, showThoughts, isPlayAudio, stepId, substepId]);

const handleRewind = (): void => {
Expand Down

0 comments on commit 568b9e0

Please sign in to comment.