Skip to content

Commit

Permalink
feat: Rename old untitled chats
Browse files Browse the repository at this point in the history
Co-authored-by: Ben Lopata <42045469+bLopata@users.noreply.github.com>
  • Loading branch information
VVoruganti and bLopata authored Jan 14, 2025
1 parent 5a7f14f commit b8c7fb4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion www/app/Chat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -446,9 +446,12 @@ What's on your mind? Let's dive in. 🌱`,

try {
// Process thought and summary in parallel if this is the first message
const isFirstChat = messages?.length === 0;
const isUntitledConversation = conversations?.find(c => c.conversationId === conversationId)?.name === 'Untitled';
const shouldGenerateSummary = isFirstChat || isUntitledConversation;
const [thoughtText] = await Promise.all([
processThought(messageToSend, conversationId!),
...(messages?.length === 0
...(shouldGenerateSummary
? [processSummary(messageToSend, conversationId!)]
: []),
]);
Expand Down

0 comments on commit b8c7fb4

Please sign in to comment.