浏览代码

fix: unfinished chat load error

Timothy J. Baek 1 年之前
父节点
当前提交
ce4973becb
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      src/routes/+page.svelte

+ 3 - 0
src/routes/+page.svelte

@@ -236,6 +236,9 @@
 	const loadChat = async (id) => {
 		const chat = await db.get('chats', id);
 		if (chatId !== chat.id) {
+			if (chat.messages.length > 0) {
+				chat.messages.at(-1).done = true;
+			}
 			messages = chat.messages;
 			title = chat.title;
 			chatId = chat.id;