From 27e7494853799e68526bfa7aa785c42d4017649a Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Tue, 16 Jul 2024 14:00:09 +0200 Subject: [PATCH] refac: title gen should only run once --- src/lib/components/chat/Chat.svelte | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/components/chat/Chat.svelte b/src/lib/components/chat/Chat.svelte index 70ce7b36a..043e18d38 100644 --- a/src/lib/components/chat/Chat.svelte +++ b/src/lib/components/chat/Chat.svelte @@ -990,7 +990,7 @@ scrollToBottom(); } - if (messages.length == 2 && messages.at(1).content !== '') { + if (messages.length == 2 && messages.at(1).content !== '' && selectedModels[0] === model.id) { window.history.replaceState(history.state, '', `/c/${_chatId}`); const _title = await generateChatTitle(userPrompt); await setChatTitle(_chatId, _title); @@ -1252,7 +1252,7 @@ scrollToBottom(); } - if (messages.length == 2) { + if (messages.length == 2 && selectedModels[0] === model.id) { window.history.replaceState(history.state, '', `/c/${_chatId}`); const _title = await generateChatTitle(userPrompt);