From 686a9920f81d0a7d3d77af136d3ae379fdaab3a6 Mon Sep 17 00:00:00 2001 From: saithsab877 Date: Tue, 24 Sep 2024 00:32:16 +0500 Subject: [PATCH] fix(ai-sources): listen button does not chnage after complete audio --- .../App/SideBar/SelectedNodeView/Default/index.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/App/SideBar/SelectedNodeView/Default/index.tsx b/src/components/App/SideBar/SelectedNodeView/Default/index.tsx index d6328f912..050cbaa80 100644 --- a/src/components/App/SideBar/SelectedNodeView/Default/index.tsx +++ b/src/components/App/SideBar/SelectedNodeView/Default/index.tsx @@ -36,7 +36,11 @@ export const Default = () => { audioElement.removeEventListener('ended', onAudioPlaybackComplete) } } - }, [setCurrentPlayingAudio]) + }, [setCurrentPlayingAudio, isPlaying]) + + useEffect(() => { + setIsPlaying(false) + }, [selectedNode]) const togglePlay = () => { if (currentPlayingAudio?.current && currentPlayingAudio.current !== audioRef.current) {