support file upload w/o a messasge

This commit is contained in:
Mike Fortman 2025-10-24 15:20:46 -05:00
parent e3e6432d37
commit 76993eea68
2 changed files with 6 additions and 4 deletions

View file

@ -201,7 +201,7 @@ export const ChatInput = forwardRef<ChatInputHandle, ChatInputProps>(
variant="default"
type="submit"
size="iconSm"
disabled={!input.trim() || loading}
disabled={(!input.trim() && !uploadedFile) || loading}
className="!rounded-md h-8 w-8 p-0"
>
{loading ? (

View file

@ -278,7 +278,6 @@ function ChatPage() {
// If this is a new conversation (no currentConversationId), set it now
if (!currentConversationId) {
console.log("Setting current conversation ID to:", result.response_id);
setCurrentConversationId(result.response_id);
refreshConversations(true);
} else {
@ -914,8 +913,11 @@ function ChatPage() {
}
}
// Pass the responseId from upload (if any) to handleSendMessage
handleSendMessage(input, uploadedResponseId || undefined);
// Only send message if there's input text
if (input.trim()) {
// Pass the responseId from upload (if any) to handleSendMessage
handleSendMessage(input, uploadedResponseId || undefined);
}
};
const toggleFunctionCall = (functionCallId: string) => {