浏览代码

Merge pull request #486 from bhulston/fix/chat-imports

Fix/chat imports
Timothy Jaeryang Baek 1 年之前
父节点
当前提交
5e32db1c57
共有 2 个文件被更改,包括 3 次插入3 次删除
  1. 1 1
      src/lib/components/chat/SettingsModal.svelte
  2. 2 2
      src/routes/(app)/c/[id]/+page.svelte

+ 1 - 1
src/lib/components/chat/SettingsModal.svelte

@@ -141,7 +141,7 @@
 	const importChats = async (_chats) => {
 		for (const chat of _chats) {
 			console.log(chat);
-			await createNewChat(localStorage.token, chat);
+			await createNewChat(localStorage.token, chat.chat);
 		}
 
 		await chats.set(await getChatList(localStorage.token));

+ 2 - 2
src/routes/(app)/c/[id]/+page.svelte

@@ -7,7 +7,7 @@
 	import { page } from '$app/stores';
 
 	import { models, modelfiles, user, settings, chats, chatId, config } from '$lib/stores';
-	import { copyToClipboard, splitStream } from '$lib/utils';
+	import { copyToClipboard, splitStream, convertMessagesToHistory } from '$lib/utils';
 
 	import { generateChatCompletion, generateTitle } from '$lib/apis/ollama';
 	import { createNewChat, getChatById, getChatList, updateChatById } from '$lib/apis/chats';
@@ -103,7 +103,7 @@
 				selectedModels =
 					(chatContent?.models ?? undefined) !== undefined
 						? chatContent.models
-						: [chatContent.model ?? ''];
+						: [chatContent.models ?? ''];
 				history =
 					(chatContent?.history ?? undefined) !== undefined
 						? chatContent.history