support file upload w/o a messasge
This commit is contained in:
parent
e3e6432d37
commit
76993eea68
2 changed files with 6 additions and 4 deletions
|
|
@ -201,7 +201,7 @@ export const ChatInput = forwardRef<ChatInputHandle, ChatInputProps>(
|
||||||
variant="default"
|
variant="default"
|
||||||
type="submit"
|
type="submit"
|
||||||
size="iconSm"
|
size="iconSm"
|
||||||
disabled={!input.trim() || loading}
|
disabled={(!input.trim() && !uploadedFile) || loading}
|
||||||
className="!rounded-md h-8 w-8 p-0"
|
className="!rounded-md h-8 w-8 p-0"
|
||||||
>
|
>
|
||||||
{loading ? (
|
{loading ? (
|
||||||
|
|
|
||||||
|
|
@ -278,7 +278,6 @@ function ChatPage() {
|
||||||
|
|
||||||
// If this is a new conversation (no currentConversationId), set it now
|
// If this is a new conversation (no currentConversationId), set it now
|
||||||
if (!currentConversationId) {
|
if (!currentConversationId) {
|
||||||
console.log("Setting current conversation ID to:", result.response_id);
|
|
||||||
setCurrentConversationId(result.response_id);
|
setCurrentConversationId(result.response_id);
|
||||||
refreshConversations(true);
|
refreshConversations(true);
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -914,8 +913,11 @@ function ChatPage() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Pass the responseId from upload (if any) to handleSendMessage
|
// Only send message if there's input text
|
||||||
handleSendMessage(input, uploadedResponseId || undefined);
|
if (input.trim()) {
|
||||||
|
// Pass the responseId from upload (if any) to handleSendMessage
|
||||||
|
handleSendMessage(input, uploadedResponseId || undefined);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const toggleFunctionCall = (functionCallId: string) => {
|
const toggleFunctionCall = (functionCallId: string) => {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue