fix: ChatBubble crash and DeepSeek API compatibility
- Fix ChatBubble to handle non-string content with String() wrapper - Fix API route to use generateText for non-streaming requests - Add @ai-sdk/openai-compatible for non-OpenAI providers (DeepSeek, etc.) - Use Chat Completions API instead of Responses API for compatible providers - Update ChatBubble tests and fix component exports to kebab-case - Remove stale PascalCase ChatBubble.tsx file
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
'use client';
|
||||
|
||||
import { useState } from 'react';
|
||||
import { useState, useEffect } from 'react';
|
||||
import { Trash2 } from 'lucide-react';
|
||||
import { useChatStore } from '@/lib/store/chat-store';
|
||||
import { Sheet } from './Sheet';
|
||||
@@ -40,6 +40,11 @@ export function DraftViewSheet() {
|
||||
const [toastShow, setToastShow] = useState(false);
|
||||
const [toastMessage, setToastMessage] = useState('');
|
||||
|
||||
// Fix: Reset toast when opening a new draft
|
||||
useEffect(() => {
|
||||
setToastShow(false);
|
||||
}, [currentDraft, showDraftView]);
|
||||
|
||||
const showCopyToast = (message: string = 'Copied to clipboard!') => {
|
||||
setToastMessage(message);
|
||||
setToastShow(true);
|
||||
|
||||
Reference in New Issue
Block a user