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

Fix/chat imports
This commit is contained in:
Timothy Jaeryang Baek 2024-01-16 00:36:38 -08:00 committed by GitHub
commit 5e32db1c57
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View file

@ -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));

View file

@ -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