Ver Fonte

Fix issue #5563: [Bug]: Prompt is not deleted when the user sends a message (#5564)

OpenHands há 1 ano atrás
pai
commit
92c166551f
1 ficheiros alterados com 5 adições e 5 exclusões
  1. 5 5
      frontend/src/components/features/chat/chat-input.tsx

+ 5 - 5
frontend/src/components/features/chat/chat-input.tsx

@@ -83,11 +83,11 @@ export function ChatInput({
   };
 
   const handleSubmitMessage = () => {
-    if (value || (textareaRef.current?.value && !value)) {
-      onSubmit(value || textareaRef.current?.value || "");
-      if (value) {
-        onChange?.("");
-      } else if (textareaRef.current) {
+    const message = value || textareaRef.current?.value || "";
+    if (message) {
+      onSubmit(message);
+      onChange?.("");
+      if (textareaRef.current) {
         textareaRef.current.value = "";
       }
     }