diff --git a/src/components/configurator/VoiceAgent.tsx b/src/components/configurator/VoiceAgent.tsx index 92c8b57..c878c77 100644 --- a/src/components/configurator/VoiceAgent.tsx +++ b/src/components/configurator/VoiceAgent.tsx @@ -73,17 +73,18 @@ export default function VoiceAgent({ locale, onComplete }: VoiceAgentProps) { } }, [transcript]); - // Handle completion + // Handle completion — end the call, then transition useEffect(() => { if (completedBrief && completedFormData) { - console.log('[VoiceAgent] Brief complete, transitioning in 1.5s...'); + console.log('[VoiceAgent] Brief complete, ending conversation and transitioning in 1.5s...'); + endConversation(); const timer = setTimeout(() => { console.log('[VoiceAgent] Calling onComplete'); onComplete(completedBrief, completedFormData); }, 1500); return () => clearTimeout(timer); } - }, [completedBrief, completedFormData, onComplete]); + }, [completedBrief, completedFormData, onComplete, endConversation]); // Orb animation driven by agent amplitude const amplitudeValue = useMotionValue(0); @@ -255,7 +256,7 @@ export default function VoiceAgent({ locale, onComplete }: VoiceAgentProps) { {/* Controls */}