fix: bug fix that input message gone out though new chat is not sent yet

This commit is contained in:
d-kimsuon
2025-09-07 17:12:11 +09:00
parent e7c3c87b2c
commit ca31602933
3 changed files with 7 additions and 7 deletions

View File

@@ -8,7 +8,7 @@ import { InlineCompletion } from "./InlineCompletion";
export interface ChatInputProps {
projectId: string;
onSubmit: (message: string) => void;
onSubmit: (message: string) => Promise<void>;
isPending: boolean;
error?: Error | null;
placeholder: string;
@@ -43,9 +43,9 @@ export const ChatInput: FC<ChatInputProps> = ({
const fileCompletionRef = useRef<FileCompletionRef>(null);
const helpId = useId();
const handleSubmit = () => {
const handleSubmit = async () => {
if (!message.trim()) return;
onSubmit(message.trim());
await onSubmit(message.trim());
setMessage("");
};

View File

@@ -7,8 +7,8 @@ export const NewChat: FC<{
}> = ({ projectId, onSuccess }) => {
const startNewChat = useNewChatMutation(projectId, onSuccess);
const handleSubmit = (message: string) => {
startNewChat.mutate({ message });
const handleSubmit = async (message: string) => {
await startNewChat.mutateAsync({ message });
};
return (

View File

@@ -12,8 +12,8 @@ export const ResumeChat: FC<{
}> = ({ projectId, sessionId, isPausedTask, isRunningTask }) => {
const resumeChat = useResumeChatMutation(projectId, sessionId);
const handleSubmit = (message: string) => {
resumeChat.mutate({ message });
const handleSubmit = async (message: string) => {
await resumeChat.mutateAsync({ message });
};
const getButtonText = () => {