refac: title gen should only run once

This commit is contained in:
Timothy J. Baek 2024-07-16 14:00:09 +02:00
parent f0a8aca0e3
commit 27e7494853

View File

@ -990,7 +990,7 @@
scrollToBottom(); 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}`); window.history.replaceState(history.state, '', `/c/${_chatId}`);
const _title = await generateChatTitle(userPrompt); const _title = await generateChatTitle(userPrompt);
await setChatTitle(_chatId, _title); await setChatTitle(_chatId, _title);
@ -1252,7 +1252,7 @@
scrollToBottom(); scrollToBottom();
} }
if (messages.length == 2) { if (messages.length == 2 && selectedModels[0] === model.id) {
window.history.replaceState(history.state, '', `/c/${_chatId}`); window.history.replaceState(history.state, '', `/c/${_chatId}`);
const _title = await generateChatTitle(userPrompt); const _title = await generateChatTitle(userPrompt);