From 662b6b125833ace803ef33040b1343a43bd30b60 Mon Sep 17 00:00:00 2001 From: Jay V Date: Thu, 12 Jun 2025 13:11:29 -0400 Subject: [PATCH] share page handle undefined --- packages/web/src/components/Share.tsx | 31 ++++++++++++++----- .../src/components/markdownview.module.css | 5 ++- 2 files changed, 28 insertions(+), 8 deletions(-) diff --git a/packages/web/src/components/Share.tsx b/packages/web/src/components/Share.tsx index 3c1b4c75..3625c57e 100644 --- a/packages/web/src/components/Share.tsx +++ b/packages/web/src/components/Share.tsx @@ -167,6 +167,8 @@ export function getDiagnostics( ): string[] { const result: string[] = [] + if (diagnosticsByFile === undefined) return result + for (const diags of Object.values(diagnosticsByFile)) { for (const d of diags) { // Only keep diagnostics explicitly marked as Error (severity === 1) @@ -1395,6 +1397,7 @@ export default function Share(props: { part().toolInvocation.toolCallId ], ) + const hasError = metadata()?.error const args = part().toolInvocation.args const filePath = args.filePath const diagnostics = createMemo(() => @@ -1429,13 +1432,27 @@ export default function Share(props: { Edit {filePath} -
- -
+ + +
+ +
+
+ +
+ +
+
+
0}>