mirror of
https://github.com/sst/opencode.git
synced 2025-12-23 10:11:41 +00:00
fix: unwrap solid store part
This commit is contained in:
parent
776091cc23
commit
6a1552f65c
1 changed files with 3 additions and 2 deletions
|
|
@ -18,6 +18,7 @@ import { DiffChanges } from "./diff-changes"
|
|||
import { Markdown } from "./markdown"
|
||||
import { getDirectory, getFilename } from "@opencode-ai/util/path"
|
||||
import { sanitizePart } from "@opencode-ai/util/sanitize"
|
||||
import { unwrap } from "solid-js/store"
|
||||
|
||||
export interface MessageProps {
|
||||
message: MessageType
|
||||
|
|
@ -83,7 +84,7 @@ export function UserMessageDisplay(props: { message: UserMessage; parts: PartTyp
|
|||
|
||||
export function Part(props: MessagePartProps) {
|
||||
const component = createMemo(() => PART_MAPPING[props.part.type])
|
||||
const part = createMemo(() => sanitizePart(props.part, props.sanitize))
|
||||
const part = createMemo(() => sanitizePart(unwrap(props.part), props.sanitize))
|
||||
return (
|
||||
<Show when={component()}>
|
||||
<Dynamic component={component()} part={part()} message={props.message} hideDetails={props.hideDetails} />
|
||||
|
|
@ -175,7 +176,7 @@ PART_MAPPING["tool"] = function ToolPartDisplay(props) {
|
|||
|
||||
PART_MAPPING["text"] = function TextPartDisplay(props) {
|
||||
const part = props.part as TextPart
|
||||
const sanitized = createMemo(() => (props.sanitize ? (sanitizePart(part, props.sanitize) as TextPart) : part))
|
||||
const sanitized = createMemo(() => (props.sanitize ? (sanitizePart(unwrap(part), props.sanitize) as TextPart) : part))
|
||||
return (
|
||||
<Show when={part.text.trim()}>
|
||||
<div data-component="text-part">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue