Преглед изворни кода

fix: split not a function error

Aiden Cline пре 9 месеци
родитељ
комит
5413b16b57
1 измењених фајлова са 4 додато и 1 уклоњено
  1. 4 1
      packages/opencode/src/cli/cmd/tui/routes/session/index.tsx

+ 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