Sfoglia il codice sorgente

fix: split not a function error

Aiden Cline 3 mesi fa
parent
commit
5413b16b57

+ 4 - 1
packages/opencode/src/cli/cmd/tui/routes/session/index.tsx

@@ -1310,7 +1310,10 @@ ToolRegistry.register<typeof WriteTool>({
   container: "block",
   render(props) {
     const { theme, syntax } = useTheme()
-    const lines = createMemo(() => props.input.content?.split("\n") ?? [], [] as string[])
+    const lines = createMemo(
+      () => (typeof props.input.content === "string" ? props.input.content.split("\n") : []),
+      [] as string[],
+    )
     const code = createMemo(() => {
       if (!props.input.content) return ""
       const text = props.input.content