summaryrefslogtreecommitdiffhomepage
path: root/packages/web/src/components
diff options
context:
space:
mode:
authorJay V <[email protected]>2025-06-27 13:25:15 -0400
committerJay V <[email protected]>2025-06-27 19:10:42 -0400
commit87d62514dbce9fc0222a99d092c86ea7e6314cbb (patch)
treebb30979e2bdf908f781be14e485d368b2f5be41d /packages/web/src/components
parent2f8cf9146b0d9689cd5aa2a7cd012c128fd6f61e (diff)
downloadopencode-87d62514dbce9fc0222a99d092c86ea7e6314cbb.tar.gz
opencode-87d62514dbce9fc0222a99d092c86ea7e6314cbb.zip
docs: share page write tool bug
Diffstat (limited to 'packages/web/src/components')
-rw-r--r--packages/web/src/components/Share.tsx14
1 files changed, 7 insertions, 7 deletions
diff --git a/packages/web/src/components/Share.tsx b/packages/web/src/components/Share.tsx
index 9b953bd2d..e8879c50a 100644
--- a/packages/web/src/components/Share.tsx
+++ b/packages/web/src/components/Share.tsx
@@ -85,7 +85,7 @@ function scrollToAnchor(id: string) {
el.scrollIntoView({ behavior: "smooth" })
}
-function stripWorkingDirectory(filePath: string, workingDir?: string) {
+function stripWorkingDirectory(filePath?: string, workingDir?: string) {
if (filePath === undefined || workingDir === undefined) return filePath
const prefix = workingDir.endsWith("/") ? workingDir : workingDir + "/"
@@ -1307,9 +1307,9 @@ export default function Share(props: {
const path = createMemo(() =>
toolData()?.args.path !== data().rootDir
? stripWorkingDirectory(
- toolData()?.args.path,
- data().rootDir,
- )
+ toolData()?.args.path,
+ data().rootDir,
+ )
: toolData()?.args.path,
)
@@ -1470,7 +1470,7 @@ export default function Share(props: {
{(_part) => {
const filePath = createMemo(() =>
stripWorkingDirectory(
- toolData()?.args.filePath,
+ toolData()?.args?.filePath,
data().rootDir,
),
)
@@ -1509,7 +1509,7 @@ export default function Share(props: {
<div data-part-tool-result>
<ErrorPart>
{formatErrorString(
- toolData()?.result,
+ toolData()?.result
)}
</ErrorPart>
</div>
@@ -1528,7 +1528,7 @@ export default function Share(props: {
<div data-part-tool-code>
<CodeBlock
lang={getShikiLang(filePath())}
- code={args.content}
+ code={toolData()?.args?.content}
/>
</div>
</Show>