story-kit: accept 145_story_persist_chat_history_to_localstorage_across_rebuilds
This commit is contained in:
@@ -4,6 +4,7 @@ import { Prism as SyntaxHighlighter } from "react-syntax-highlighter";
|
||||
import { oneDark } from "react-syntax-highlighter/dist/esm/styles/prism";
|
||||
import type { PipelineState } from "../api/client";
|
||||
import { api, ChatWebSocket } from "../api/client";
|
||||
import { useChatHistory } from "../hooks/useChatHistory";
|
||||
import type { Message, ProviderConfig, ToolCall } from "../types";
|
||||
import { AgentPanel } from "./AgentPanel";
|
||||
import { ChatHeader } from "./ChatHeader";
|
||||
@@ -55,7 +56,7 @@ interface ChatProps {
|
||||
}
|
||||
|
||||
export function Chat({ projectPath, onCloseProject }: ChatProps) {
|
||||
const [messages, setMessages] = useState<Message[]>([]);
|
||||
const { messages, setMessages, clearMessages } = useChatHistory(projectPath);
|
||||
const [input, setInput] = useState("");
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [model, setModel] = useState("llama3.1");
|
||||
@@ -458,7 +459,7 @@ export function Chat({ projectPath, onCloseProject }: ChatProps) {
|
||||
console.error("Failed to cancel chat:", e);
|
||||
}
|
||||
|
||||
setMessages([]);
|
||||
clearMessages();
|
||||
setStreamingContent("");
|
||||
setLoading(false);
|
||||
setActivityStatus(null);
|
||||
|
||||
Reference in New Issue
Block a user