Merge pull request #2659 from SiYue-ZO/fix/thought-bubble-collapse-state
fix: isolate thought bubble collapse state
This commit is contained in:
commit
93e9bddc6e
2 changed files with 2 additions and 5 deletions
|
|
@ -6,7 +6,6 @@ import {
|
|||
IconDownload,
|
||||
IconFileText,
|
||||
} from "@tabler/icons-react"
|
||||
import { useAtom } from "jotai"
|
||||
import { useState } from "react"
|
||||
import { useTranslation } from "react-i18next"
|
||||
import ReactMarkdown from "react-markdown"
|
||||
|
|
@ -18,7 +17,7 @@ import remarkGfm from "remark-gfm"
|
|||
import { Button } from "@/components/ui/button"
|
||||
import { formatMessageTime } from "@/hooks/use-pico-chat"
|
||||
import { cn } from "@/lib/utils"
|
||||
import { type ChatAttachment, showThoughtsAtom } from "@/store/chat"
|
||||
import { type ChatAttachment } from "@/store/chat"
|
||||
|
||||
interface AssistantMessageProps {
|
||||
content: string
|
||||
|
|
@ -42,7 +41,7 @@ export function AssistantMessage({
|
|||
const fileAttachments = attachments.filter(
|
||||
(attachment) => attachment.type !== "image",
|
||||
)
|
||||
const [isExpanded, setIsExpanded] = useAtom(showThoughtsAtom)
|
||||
const [isExpanded, setIsExpanded] = useState(true)
|
||||
const formattedTimestamp =
|
||||
timestamp !== "" ? formatMessageTime(timestamp) : ""
|
||||
|
||||
|
|
|
|||
|
|
@ -57,8 +57,6 @@ const DEFAULT_CHAT_STATE: ChatStoreState = {
|
|||
|
||||
export const chatAtom = atom<ChatStoreState>(DEFAULT_CHAT_STATE)
|
||||
|
||||
export const showThoughtsAtom = atom<boolean>(true)
|
||||
|
||||
const store = getDefaultStore()
|
||||
|
||||
export function getChatState() {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue