From 50b1f7db12fce10eeab7a83d25a9abe423f21809 Mon Sep 17 00:00:00 2001 From: Yidadaa Date: Sat, 24 Jun 2023 22:32:46 +0800 Subject: [PATCH] feat: right-click to copy message to user input --- app/components/chat.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/components/chat.tsx b/app/components/chat.tsx index 35f28046..d4e1dcd8 100644 --- a/app/components/chat.tsx +++ b/app/components/chat.tsx @@ -605,6 +605,10 @@ export function Chat() { const onRightClick = (e: any, message: ChatMessage) => { // copy to clipboard if (selectOrCopy(e.currentTarget, message.content)) { + if (userInput.length === 0) { + setUserInput(message.content); + } + e.preventDefault(); } };