generate and save facts
This commit is contained in:
@@ -26,7 +26,6 @@ import { useEffect } from "react";
|
||||
import { trpc } from "../trpc/client.js";
|
||||
import { usePageContext } from "vike-react/usePageContext";
|
||||
import "./hover.css";
|
||||
import type { ConversationsId } from "../database/generated/public/Conversations.js";
|
||||
|
||||
export default function LayoutDefault({
|
||||
children,
|
||||
@@ -54,9 +53,13 @@ export default function LayoutDefault({
|
||||
// }
|
||||
// }, [isConversationListExpanded]);
|
||||
|
||||
function handleDeleteConversation(conversationId: string) {
|
||||
async function handleDeleteConversation(conversationId: string) {
|
||||
removeConversation(conversationId);
|
||||
trpc.chat.deleteConversation.mutate({ id: conversationId });
|
||||
await trpc.chat.deleteConversation.mutate({ id: conversationId });
|
||||
const res = await trpc.chat.createConversation.mutate();
|
||||
if (!res?.id) return;
|
||||
addConversation(res);
|
||||
await navigate(`/chat/${res.id}`);
|
||||
}
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user