mirror of
https://github.com/open-webui/open-webui
synced 2024-11-16 21:42:58 +00:00
Fix chat import bug
This commit is contained in:
parent
26f7a1c682
commit
3b7775a535
@ -141,7 +141,7 @@
|
|||||||
const importChats = async (_chats) => {
|
const importChats = async (_chats) => {
|
||||||
for (const chat of _chats) {
|
for (const chat of _chats) {
|
||||||
console.log(chat);
|
console.log(chat);
|
||||||
await createNewChat(localStorage.token, chat);
|
await createNewChat(localStorage.token, chat.chat);
|
||||||
}
|
}
|
||||||
|
|
||||||
await chats.set(await getChatList(localStorage.token));
|
await chats.set(await getChatList(localStorage.token));
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
import { page } from '$app/stores';
|
import { page } from '$app/stores';
|
||||||
|
|
||||||
import { models, modelfiles, user, settings, chats, chatId, config } from '$lib/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 { generateChatCompletion, generateTitle } from '$lib/apis/ollama';
|
||||||
import { createNewChat, getChatById, getChatList, updateChatById } from '$lib/apis/chats';
|
import { createNewChat, getChatById, getChatList, updateChatById } from '$lib/apis/chats';
|
||||||
@ -95,6 +95,8 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (chat) {
|
if (chat) {
|
||||||
|
console.log("Chat from getChatById1", chat) //Remove
|
||||||
|
console.log("Chat from getChatById2", chat.chat); // Remove
|
||||||
const chatContent = chat.chat;
|
const chatContent = chat.chat;
|
||||||
|
|
||||||
if (chatContent) {
|
if (chatContent) {
|
||||||
@ -103,7 +105,7 @@
|
|||||||
selectedModels =
|
selectedModels =
|
||||||
(chatContent?.models ?? undefined) !== undefined
|
(chatContent?.models ?? undefined) !== undefined
|
||||||
? chatContent.models
|
? chatContent.models
|
||||||
: [chatContent.model ?? ''];
|
: [chatContent.models ?? ''];
|
||||||
history =
|
history =
|
||||||
(chatContent?.history ?? undefined) !== undefined
|
(chatContent?.history ?? undefined) !== undefined
|
||||||
? chatContent.history
|
? chatContent.history
|
||||||
|
Loading…
Reference in New Issue
Block a user