Skip to content

Commit

Permalink
restore accidentlly modifed handleSubmit
Browse files Browse the repository at this point in the history
  • Loading branch information
pengyu committed Mar 4, 2025
1 parent 3f319cc commit 6fc6f1b
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions frontend/src/app/(main)/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,16 @@ export default function HomePage() {
if (!message.trim()) return;

try {
await createProjectFromPrompt(message, isPublic, model);
promptFormRef.current.clearMessage();
} catch (error) {
// Create the project
const result = await createProjectFromPrompt(message, isPublic, model);

// If successful, clear the input
if (result) {
promptFormRef.current.clearMessage();

// Note: No need to navigate here as the ProjectContext's onCompleted handler
// in the createProject mutation will handle navigation to the chat page
}} catch (error) {
console.error('Error creating project:', error);
}
};
Expand Down

0 comments on commit 6fc6f1b

Please sign in to comment.