From abbfd1dc58bf532a8301c7c0d25caec0e8e82189 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Sat, 2 Dec 2023 00:58:43 -0800 Subject: [PATCH] fix: copy code button issue --- src/lib/components/chat/Messages.svelte | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/components/chat/Messages.svelte b/src/lib/components/chat/Messages.svelte index caefcdce..cc27bdee 100644 --- a/src/lib/components/chat/Messages.svelte +++ b/src/lib/components/chat/Messages.svelte @@ -40,7 +40,7 @@ blocks.forEach((block) => { // only add button if browser supports Clipboard API - if (navigator.clipboard && block.childNodes.length < 2) { + if (navigator.clipboard && block.childNodes.length < 2 && block.id !== 'user-message') { let code = block.querySelector('code'); code.style.borderTopRightRadius = 0; code.style.borderTopLeftRadius = 0; @@ -425,7 +425,7 @@ {/each} {/if} -
{message.content}
+
{message.content}
{#if message.parentId !== null && message.parentId in history.messages && (history.messages[message.parentId]?.childrenIds.length ?? 0) > 1}