fix deletion bug

This commit is contained in:
Mckay Wrigley
2023-03-15 08:32:21 -06:00
parent 742efea50d
commit c40f755cac
3 changed files with 5 additions and 2 deletions
+3 -1
View File
@@ -119,8 +119,10 @@ export default function Home() {
};
const handleNewConversation = () => {
const lastConversation = conversations[conversations.length - 1];
const newConversation: Conversation = {
id: conversations.length + 1,
id: lastConversation ? lastConversation.id + 1 : 1,
name: "",
messages: []
};