Skip to content

Commit edd507b

Browse files
committed
fix: sending of sample messages
1 parent a797e41 commit edd507b

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

frontend/src/components/chat/chat-input.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,20 +47,20 @@ export const ChatInput = ({
4747
});
4848
};
4949

50-
const handleSend = async (e: React.FormEvent) => {
51-
console.log('handleSend', chatId, message);
50+
const handleSend = async (input?: string) => {
51+
console.log('handleSend', chatId, message, input);
5252
setMessage('');
5353
if (chat?.status === 'wait_for_human_input') {
54-
await handleHumanInput(message);
54+
await handleHumanInput(input || message);
5555
} else {
56-
onSend(message);
56+
onSend(input || message);
5757
}
5858
};
5959

6060
const handleKeyDown = (e: React.KeyboardEvent<HTMLTextAreaElement>) => {
6161
console.log('handleKeyDown', chatId, e.key);
6262
if (e.key === 'Enter' && !e.shiftKey) {
63-
handleSend(e as any);
63+
handleSend();
6464
}
6565
};
6666

@@ -147,7 +147,7 @@ export const ChatInput = ({
147147
key={index}
148148
variant="outline"
149149
size="sm"
150-
onClick={() => setMessage(message)}
150+
onClick={() => handleSend(message)}
151151
className="h-6 text-xs text-muted-foreground line-clamp-1 flex items-center justify-start"
152152
>
153153
{message}

0 commit comments

Comments
 (0)