From c6f752a096b1906d688ea520bde38d9c29af32f2 Mon Sep 17 00:00:00 2001 From: Haileyesus Date: Mon, 23 Feb 2026 09:24:32 +0300 Subject: [PATCH] fix: reset copy state after copying in Markdown component There were 2 issues. 1. The copy state was not being reset after copying, which caused the "Copied!" message to persist indefinitely. 2. The return value from the copy function was not being used to determine if the copy was successful. Even on `false`(i.e. copy unsuccessful), the user would see a success message. --- .../chat/view/subcomponents/Markdown.tsx | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/components/chat/view/subcomponents/Markdown.tsx b/src/components/chat/view/subcomponents/Markdown.tsx index bbb3db1..bdd6ec2 100644 --- a/src/components/chat/view/subcomponents/Markdown.tsx +++ b/src/components/chat/view/subcomponents/Markdown.tsx @@ -32,9 +32,8 @@ const CodeBlock = ({ node, inline, className, children, ...props }: CodeBlockPro if (shouldInline) { return ( {children} @@ -53,7 +52,14 @@ const CodeBlock = ({ node, inline, className, children, ...props }: CodeBlockPro