File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77 OPENAI_VOICE ,
88 useOpenAIVoiceChat as OpenAIVoiceChat ,
99} from "lib/ai/speech/open-ai/use-voice-chat.openai" ;
10- import { cn , groupBy } from "lib/utils" ;
10+ import { cn , groupBy , isNull } from "lib/utils" ;
1111import {
1212 CheckIcon ,
1313 Loader ,
@@ -245,6 +245,17 @@ export function ChatBotVoice() {
245245 }
246246 } , [ voiceChat . isOpen ] ) ;
247247
248+ useEffect ( ( ) => {
249+ if ( ! voiceChat . isOpen && ! isNull ( voiceChat . agentId ) ) {
250+ appStoreMutate ( ( prev ) => ( {
251+ voiceChat : {
252+ ...prev . voiceChat ,
253+ agentId : undefined ,
254+ } ,
255+ } ) ) ;
256+ }
257+ } , [ voiceChat . isOpen ] ) ;
258+
248259 useEffect ( ( ) => {
249260 if ( error && isActive ) {
250261 toast . error ( error . message ) ;
@@ -254,6 +265,7 @@ export function ChatBotVoice() {
254265
255266 useEffect ( ( ) => {
256267 if ( voiceChat . isOpen ) return ;
268+
257269 const handleKeyDown = ( e : KeyboardEvent ) => {
258270 const isVoiceChatEvent = isShortcutEvent ( e , Shortcuts . toggleVoiceChat ) ;
259271 if ( isVoiceChatEvent ) {
You can’t perform that action at this time.
0 commit comments