Skip to content

Commit

Permalink
set the chat session id once when the chat is opened (#1674)
Browse files Browse the repository at this point in the history
  • Loading branch information
JosiasAurel committed May 13, 2024
1 parent 3353fa7 commit 5c3f1f5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/popups-etc/chat-component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { Signal, useSignal } from "@preact/signals";
import { RiChatDeleteLine } from "react-icons/ri";
import markdown from "@wcj/markdown-to-html";
import { nanoid } from "nanoid";
import { useState } from "preact/hooks";

interface ChatProps {
persistenceState: Signal<PersistenceState>;
Expand Down Expand Up @@ -46,7 +47,7 @@ Answer the questions that follow based on this unless new code is provided.`;
const input = useSignal("");

const info = useSignal("");
const chatSession = nanoid(10);
const [chatSession, _setChatSession] = useState(nanoid(10));
const email = persistenceState?.value?.session?.user.email;

const sendMessage = async (message: string) => {
Expand Down

0 comments on commit 5c3f1f5

Please sign in to comment.