diff --git a/src/components/assistants/AssistantsPanel.tsx b/src/components/assistants/AssistantsPanel.tsx index a4c46a3..627affe 100644 --- a/src/components/assistants/AssistantsPanel.tsx +++ b/src/components/assistants/AssistantsPanel.tsx @@ -109,7 +109,7 @@ export function AssistantsPanel({ onToggleCollapse, onCreateNew, onEditAssistant }, []) const handleConfirmDelete = useCallback(async () => { - if (!assistantToDelete) return + if (!assistantToDelete || !currentProfile?.id) return // Verify the confirmation input matches the assistant name if (confirmationInput !== assistantToDelete) { diff --git a/src/components/chat/ChatView.tsx b/src/components/chat/ChatView.tsx index 9b2923b..01f0c88 100644 --- a/src/components/chat/ChatView.tsx +++ b/src/components/chat/ChatView.tsx @@ -201,7 +201,7 @@ export function ChatView({ assistantName }: ChatViewProps) {
{messages.map((message, idx) => ( { + // Initialize stream id from first chunk if not yet set (handles race condition) + if (!currentStreamIdRef.current) { + currentStreamIdRef.current = streamId + } if (streamId !== currentStreamIdRef.current) return switch (chunk.type) {