automatically open the side bar when a new chat is created with the default agent.

This commit is contained in:
sabaimran
2025-01-21 11:56:06 -08:00
parent c43079cb21
commit e3e93e091d
2 changed files with 9 additions and 3 deletions

View File

@@ -40,6 +40,7 @@ interface ChatHistoryProps {
publicConversationSlug?: string;
setAgent: (agent: AgentData) => void;
customClassName?: string;
setIsChatSideBarOpen?: (isOpen: boolean) => void;
}
interface TrainOfThoughtComponentProps {
@@ -149,6 +150,7 @@ export default function ChatHistory(props: ChatHistoryProps) {
latestUserMessageRef.current?.scrollIntoView({ behavior: "auto", block: "start" });
});
}
}, [data, currentPage]);
useEffect(() => {
@@ -251,6 +253,9 @@ export default function ChatHistory(props: ChatHistoryProps) {
};
props.setAgent(chatData.response.agent);
setData(chatMetadata);
if (props.setIsChatSideBarOpen) {
props.setIsChatSideBarOpen(true);
}
}
setHasMoreMessages(false);