Timothy Jaeryang Baek 2 月之前
父節點
當前提交
699c8073ff
共有 1 個文件被更改,包括 8 次插入1 次删除
  1. 8 1
      src/lib/components/layout/SearchModal.svelte

+ 8 - 1
src/lib/components/layout/SearchModal.svelte

@@ -37,7 +37,9 @@
 	let history = null;
 	let messages = null;
 
-	$: loadChatPreview(selectedIdx);
+	$: if (!chatListLoading && chatList) {
+		loadChatPreview(selectedIdx);
+	}
 
 	const loadChatPreview = async (selectedIdx) => {
 		if (!chatList || chatList.length === 0) {
@@ -98,6 +100,11 @@
 			}, 500);
 		}
 
+		selectedChat = null;
+		messages = null;
+		history = null;
+		selectedModels = [''];
+
 		if ((chatList ?? []).length === 0) {
 			allChatsLoaded = true;
 		} else {