Browse Source

feat: right-click to copy message to user input

Yidadaa 1 year ago
parent
commit
50b1f7db12
1 changed files with 4 additions and 0 deletions
  1. 4 0
      app/components/chat.tsx

+ 4 - 0
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();
     }
   };