Name conversations automatically #86 (#90)

This commit is contained in:
CMarghin 2023-03-23 07:11:01 +00:00 committed by GitHub
parent 172bb8e5b1
commit 52004c938b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 0 deletions

View File

@ -81,6 +81,16 @@ export default function Home() {
return; return;
} }
if (updatedConversation.messages.length === 1) {
const {content} = message
const customName = content.length > 30 ? content.substring(0, 30) + "..." : content;
updatedConversation = {
...updatedConversation,
name: customName
};
}
setLoading(false); setLoading(false);
const reader = data.getReader(); const reader = data.getReader();