From b206e16c02976c56fae310dc0eac92872395261c Mon Sep 17 00:00:00 2001 From: broBinChen <139344558+broBinChen@users.noreply.github.com> Date: Fri, 5 Dec 2025 13:07:14 +0800 Subject: [PATCH] fix: clear files when clicking text-only examples (#82) Fixed an issue where files from previous examples would persist when clicking on "Animated Diagram" or "Creative Drawing" examples that don't require image uploads. --- components/chat-example-panel.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/components/chat-example-panel.tsx b/components/chat-example-panel.tsx index 591e623..05daedd 100644 --- a/components/chat-example-panel.tsx +++ b/components/chat-example-panel.tsx @@ -90,7 +90,10 @@ export default function ExamplePanel({ icon={} title="Animated Diagram" description="Draw a transformer architecture with animated connectors" - onClick={() => setInput("Give me a **animated connector** diagram of transformer's architecture")} + onClick={() => { + setInput("Give me a **animated connector** diagram of transformer's architecture") + setFiles([]) + }} /> } title="Creative Drawing" description="Draw something fun and creative" - onClick={() => setInput("Draw a cat for me")} + onClick={() => { + setInput("Draw a cat for me") + setFiles([]) + }} />